information displaying on screen

Hello everybody , i hope i am posting this in the right place, correct me if im wrong.

Im new to linux go easy please.

Heres my deal , i have about 200 machines with opensuse11.4 KDE on them, i would like certain information to stick to the background kinda like a
widget type of thing that can not be removed by a user (no admin rights) and it has to start on machine boot up and also these pcs are continually moving to different spots in our building but on the same network so idk if that changes anything with configuring the ip address… the only things that need to be visible are as fallows :

Host name
User name
IP address
domain

so basically widgets are useless to me, unless somebody knows how to configure these the way i need them or maybe there is something better then widgets… i came here to get the right answer from all you geniuses out there instead of trying to hop around on google and whatnot…

let me know what my options are and how i can roll this out on 200 pc efficiently.

Thanks

You could write a script that echoes the required info to a textfile, then use ‘wall’ (run as root) to display it on the desktop as a system message. Now this can be clicked away, but you just create a cron job to run it periodically (so that it is re-displayed)

man wall for more info

i dont really know anything about scripts so it would be difficult for me to do this and also this needs to be on there at all times

You can use conky, configure it in /etc/conky/conky.conf (system wide) and run it as root, so that users cannot kill the process. Have a look at this thread: Conky question.

hummm conky looks like a good idea, is there any other solutions that might not take so long to preform on 200 pcs

so i took a look at conky , it looked good so i tested it and it worked great, i need to put this whole process into a script so i can push it out to the 200 pcs , how do i go about doing this, basically the script needs to install conky then edit its file to the code i need it to be , i kinda looked at stuff about scripts, and got this far

#!/bin/bash
clear
echo "conky script"
sudo zypper ar http://download.opensuse.org/repositories/server:/monitoring/openSUSE_11.4/ server:monitoring
sudo zypper in conky
kdesu kwrite /etc/conky/conky.conf

does this look right so far ? if so what is my next step in entering the data into /etc/conky/conky.conf ???/

anybody ^^^^^^

To create a basic user or system conky.conf, you might want to try the conkyconf script in my repo. (see this post: Conky question).

To install conky from script, it’s enough to run this as root:

[noparse]zypper ar http://download.opensuse.org/repositories/openSUSE:/11.4:/Contrib/standard/  openSUSE:Contrib
zypper refresh
zypper in conky[/noparse]

To install conky, conkyconf and conkyweather, you can use this:

[noparse]
zypper ar http://download.opensuse.org/repositories/openSUSE:/11.4:/Contrib/standard/  openSUSE:Contrib
zypper ar http://download.opensuse.org/repositories/home:/please_try_again/openSUSE_11.4/ PTA
zypper refresh
zypper in conkyconf[/noparse]

Of course, you can put these commands in a script.

conky is available in several repos. I just noticed that the version in [noparse]http://download.opensuse.org/repositories/server:/monitoring/openSUSE_11.4[/noparse] is indeed newer. So you might want to use this one instead (I haven’t so far).

ok i got that part, i was wondering as to how i can push this process out to 200 pcs,a scrip will work right ? make the script install conky then edits its config file ? i can push this script out to all 200 pcs . Correct ?

Yes, of course.
Insert the line:

#! /bin/bash

make it executable

chmod 755 scriptname

and run it as root.

But IMO you should also write a script to edit the config file on the 200 pcs (or use conkyconf or modify it so that it does what you want).

sorry i am still a noobe with the terminal ,so lets see if i got this right so far.

i enter this in a new text editor correct ? and its a script correct ? so this theoretically should install conky if i run this script on a computer after making executable ,correct ?

#! /bin/bash
zypper ar http://download.opensuse.org/repositories/openSUSE:/11.4:/Contrib/standard/  openSUSE:Contrib
zypper refresh
zypper in conky

now to make it able to run in the terminal (executable) i do the

chmod 755 scriptname

Correct ?

now if thats all correct then how do i tell the script to edit the conky config file , i know if i do

kdesu kwrite /etc/conky/conky.conf

in the terminal it will open text editor and allow me to edit the file, now how would i make the script open it, erase whats in there (the default conky config) then paste my config that i want ???

lol this is a little confusing but bare with me here

yes.

Yes, but make the script executable before you copy it to 200 pcs if that’s what you intend to do.

Do not confuse /etc/conky/conky.conf, which is conky system-wide configuration file with conkyconf, which is a script I wrote, available im my repo. (see this post: Conky question). To use conkyconf, you have to install it first. It is not included in conky. The package “conkyconf” also include a LUA script and the conky configuration file it creates will use LUA to color processes which use the most CPU or memory resources in red or to gradient CPU usage and fsbars. It also install another program, conkyweather (which I packaged but didn’t write). You can see screenshots in this post (which is not about conky) : Thèmes et couleurs d’OpenOffice/LIbreOffice.

/etc/conky/conky.conf is the syste-wide configuration file for conky. It has to be edited by root.
Users normally will have a ~/.conkyrc file (that they can edit) .

conkyconf can create both, system-wide (/etc/conky/conky.conf) and user (~/.conkyrc) configuration files. You have to be root to modify /etc/conky/conky.conf (and thus use kdesu). Each user can modify his ~/.conkyrc. If ~/.conkyrc exists, conky will read its configuation from this file. Otherwise it will use the system-wide configuration. Once a config file has been created with conkyconf, you can modify it - add/remove stuff - of course.

BTW, I intend to modify **conkyconf ** (my script) as soon as I know how to deal with transparency under KDE when compositing is off - but it might simply not be possible at all.

now im super confused, the file i am editing is the /etc/conky/conky.conf and when i run conky in the terminal it displays the outcome of what i just edited. which is what i want, every computer needs to have the same exact config, which is y i need a script to install conky then edit its “system-wide configuration”. i have the script able to install conky, but i do not know how to make it edit the file /etc/conky/conky.conf after it is completed installing conky.

Do you know how to edit this file? It’s not a bash script. It uses it’s own settings, variables and syntax. If you don’t know how to configure conky, use conkyconf (which writes a config file for you). If you install conkyconf and run:

conkyconf

it creates the file ~/.conkyrc of the current user.

if you run

conkyconf -s

it creates the system-wide /etc/conky/conky.conf.

To display all options, run:

conkyconf -h

When you’ve done that, you can start conky:

conky

If it sounds too complicated, forget about conkyconf. However using it is much much easier then learning conky (and Lua). If you want to create/edit conky configuration file yourself (without the help of conkyconf), you should start with some configuration example and read the conky documentation to learn how to modify it to match your needs: Conky - Documentation. You need to know the variables and the configuration settings.

i fell like we are not on the same page … ill tell you exactually what i am doing ,

so i installed conky,
then i go to terminal and type

kdesu kwrite /etc/conky/conky.conf

then when the text editor opens i delete all the junk thats in there and enter this code

# conky configuration

# set to yes if you want Conky to be forked in the background
background no

# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*

# Use Xft?
use_xft yes

# Xft font when Xft is enabled
xftfont Bitstream Vera Sans Mono:size=10

# Text alpha when using Xft
xftalpha 0.8

# Update interval in seconds
update_interval 1.0

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Create own window instead of using desktop (required in nautilus)
own_window yes

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 400 0
maximum_width 400

# Draw shades?
draw_shades yes

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no
draw_graph_borders yes

# Stippled borders?
stippled_borders 8

# border margins
#border_margin 4

# border width
border_width 1

# Default colors and also border colors
default_color white
default_shade_color black
default_outline_color white

# own window options
#own_window		yes
#own_window_transparent	yes
#own_window_type		override
#own_window_hints	undecorated,below,sticky,skip_taskbar,skip_pager

own_window_argb_visual
own_window yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment top_middle
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 10
gap_y 35

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer right

#short_units yes

# colours
color1 white
# light blue
color2 6892C6
# orange
#E77320
color3 FC8820
# green
color4 78BF39
# red
color5 CC0000
# yellow
color6 FAFA00
# purple
color7 FF00FF

text_buffer_size 2048

# variable is given either in format $variable or in ${variable}. Latter
# allows characters right after the variable and must be used in network
# stuff because of an argument

# stuff after 'TEXT' will be formatted on screen

TEXT
Hostname:  ${nodename}
User:      ${exec whoami}
IP Address: ${addr eth0}
Domain:    ${exec hostname -d}

and the outcome is exactually what i ask for which is the hostname , user , ip address , and domain .

so i dont really understand the significance of the conkyconf, the users of the computers will not be editing this file, the computer is completely locked down for them all they can do is pretty much do there work which is on the web …

If you don’t understand what it does, then you don’t need it.
Conky can monitor many things, like processor, memory, filesystem usage, temperature (depending on the available sensors), use conditional expressions in its configuration file and LUA scripts to add features and enhance the appearance. If all you need is that:

# stuff after 'TEXT' will be formatted on screen

TEXT
Hostname:  ${nodename}
User:      ${exec whoami}
IP Address: ${addr eth0}
Domain:    ${exec hostname -d}

You don’t need conkyconf. I was just suggesting an easier way to create a configuration file (which can be complicated to edit manually depending of what you want to monitor and how) but didn’t realize that the type of configuration you need was so basic. The configuration above will work on all computers and you obviously don’t need a script to create it.

lol this is hard to explain, i fully understand the point of conky, i dont see the purpose of making a conkyconf if i am not haveing any users change anything about it and the file conky.conf works perfectly fine , and as for the script part , i still need to push this out to 200 pcs , im not going to go to every one and install the package then open the text editor then enter the code , it would take way to much time and is not efficient , i was looking to have the script do all this for me and i can just push the script out to all 200 pcs.

Again, you don’t need it because what you are monitoring is the same on all computers. You don’t even need conky for such simple information. You’re not monitoring hardware or system related information which will be different on all computers. If you would have to edit conky configuration based on hardware (sensors have different names, computers have 1, 2 or 4 CPUs), files sytem usage (computers have different partitions) and many other things, you would understand the benefit of having a script scanning the hardware and querying the system and writing the configuration file for you. Doing it manually on so many computers would take days … or weeks.
So, since this is not the case here, forget about conkyconf, as this is not for you! Sorry for having confused you. You did also confused me, because - for a short moment - I didn’t get how someone having to install stuff on 200 Linux computers would ask such questions about how to write a zypper command in a bash script.

Anyway … If the /etc/conky/conky.conf you posted does what you want - which I cannot tell - and you want to install conky and use this configuration on your 200 computers. Here’s the script you need to do both.

#! /bin/bash

 $UID -eq 0 ] || exec echo "Root User Permissions are required."


zypper ar -f http://download.opensuse.org/repositories/openSUSE:/11.4:/Contrib/standard/  openSUSE:Contrib
zypper --gpg-auto-import-keys refresh
zypper --non-interactive in conky


cat > /etc/conky/conky.conf << EOFCONKCONF

# conky configuration

# set to yes if you want Conky to be forked in the background
background no

# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*

# Use Xft?
use_xft yes

# Xft font when Xft is enabled
xftfont Bitstream Vera Sans Mono:size=10

# Text alpha when using Xft
xftalpha 0.8

# Update interval in seconds
update_interval 1.0

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Create own window instead of using desktop (required in nautilus)
own_window yes

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 400 0
maximum_width 400

# Draw shades?
draw_shades yes

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no
draw_graph_borders yes

# Stippled borders?
stippled_borders 8

# border margins
#border_margin 4

# border width
border_width 1

# Default colors and also border colors
default_color white
default_shade_color black
default_outline_color white

# own window options
#own_window		yes
#own_window_transparent	yes
#own_window_type		override
#own_window_hints	undecorated,below,sticky,skip_taskbar,skip_pager

own_window_argb_visual
own_window yes
own_window_transparent yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment top_middle
#alignment bottom_left
#alignment bottom_right

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 10
gap_y 35

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer right

#short_units yes

# colours
color1 white
# light blue
color2 6892C6
# orange
#E77320
color3 FC8820
# green
color4 78BF39
# red
color5 CC0000
# yellow
color6 FAFA00
# purple
color7 FF00FF

text_buffer_size 2048

# variable is given either in format \$variable or in \${variable}. Latter
# allows characters right after the variable and must be used in network
# stuff because of an argument

# stuff after 'TEXT' will be formatted on screen

TEXT
Hostname:  \${nodename}
User:      \${exec whoami}
IP Address: \${addr eth0}
Domain:    \${exec hostname -d}

EOFCONKCONF

Simply run this script as root or sudo on your 200 PCs and it will install conky and your conky.conf.

ahhhhhhhh thats exactly what i was looking for , finally we come to agreement as to what i want to do lol , sorry for possibly making it sound alot more complicated then it really is , so in my script pretty much all i was missing is

cat > /etc/conky/conky.conf << EOFCONKCONF

hahahah thanks for all your help and for all the additional information