[rrd-users] Would you please take a look at my current congfiguration and off er any suggestions?

Collins, Eric S. ESCollins at APACMail.com
Fri Nov 15 00:54:49 MET 2002

The box I am using to run all of this is a Dual Pent. Pro 200 Mhz system
with 224 Megs RAM and two 10,000 RPM wide ultra SCSI drives, no raid config.
The box itself is a Compaq Proliant 2500. I have been unable to get any of
the Redhat installs starting with 7.1+ I believe the 2.4 kernel just doesn't
like my hardware. I have tried just about every install config myself and
our linux team could think of. This is a moot point, but figured I'd mention
it in case a suggestion would be to install RH 7.1+. 
    Ok, I currently use rrdtool (v1.0.4)to graph system load, number of
users, number of users (process specific), and some other various
information. The way I currently am populating my round robin databases is
as follows -
1. My RH7 system kicks off a shell script on each remote SCO UNIX server
(Openserver 5 Enterprise) using rsh to execute the command. 
The cron script to kick off the remote script is broken into 4 like scripts,
due to network issues, and the fact I update these rrd's every minute I have
only a portion of the systems checked with each cron script.
for example.. I have a /etc/cron.minute directory that executes everything
in that location every minute
I have graph1 (used to graph the stored data for all remote servers)
I have 4 scripts called updatec, updatec2, updatec3 and updatec4. These are
identical, except each of these scripts points to a file with a portion of
the unames for my remote facilities.
    Please forgive my newbie level shell scripting.
Snapshot of /etc/cron.minute
-rwxr-xr-x      1 root     root          238 Nov 13 20:28 graph1
lrwxrwxrwx    1 root     root           34 Nov 13 20:28 updatec ->
lrwxrwxrwx    1 root     root           35 Nov 13 20:28 updatec2 ->
lrwxrwxrwx    1 root     root           35 Nov 13 20:28 updatec3 ->
lrwxrwxrwx    1 root     root           35 Nov 13 20:28 updatec4 ->
graph1 script
CENTERS=$(cat /usr/local/rrdwork/graph_centers) #This is a list of all
current remote facilities, i.e. norda1 norda2
for center in $CENTERS;do
/usr/local/rrdwork/graph_hour $center >> /dev/null # these graph_*  files
are duplicates, with the only difference being the time ranges
/usr/local/rrdwork/graph_day $center >> /dev/null
/usr/local/rrdwork/graph_week $center >> /dev/null
exit 0

updatec script example
(This script executes the rsh command and writes to a .log file and to the
database file *.rrd. The .log files are used when generating the graphs to
add non database stored information, such as current remote system time.)
FACS=$(cat /usr/local/rrdwork/centers)         #the updatec2 script would
reference /usr/local/rrdwork/centers2, this is the only difference in these
for fac in $FACS ;do                                    #so I have each
group of remote systems broken up into 4 centers* files.
master=`rsh $fac /bin/totinf`
   ld=`echo "$master"|gawk '{ if (NR == 1) print $0 }'`
   users=`echo "$master"|gawk '{ if (NR == 2) print $0 }'`
   tout=`echo "$master"|gawk '{ if (NR == 3) print $0 }'`
   tout2=`echo "$master"|gawk '{ if (NR == 4) print $0 }'`
   systime=`echo "$master"|gawk '{ if (NR == 5) print $0 }'`
   cpu=`echo "$master"|gawk '{ if (NR == 6) print $0 }'`
   uptim=`echo "$master"|gawk '{if (NR == 7) print $0}'`
   cmv=`echo "$master"|gawk '{ if (NR == 8) print $0}'`
rrdtool update /usr/local/rrdwork/rrds/$fac.rrd N:$ld:$users:$tout:$tout2
if [ -e /usr/local/rrdwork/logs/$fac.log ] ; then >
/usr/local/rrdwork/logs/$fac.log; fi
echo "$ld" >> /usr/local/rrdwork/logs/$fac.log
echo "$users" >> /usr/local/rrdwork/logs/$fac.log
echo "$tout" >> /usr/local/rrdwork/logs/$fac.log
echo "$tout2" >> /usr/local/rrdwork/logs/$fac.log
echo "$systime" >> /usr/local/rrdwork/logs/$fac.log
echo "$cpu" >> /usr/local/rrdwork/logs/$fac.log
echo "$uptim" >> /usr/local/rrdwork/logs/$fac.log
echo "$cmv" >> /usr/local/rrdwork/logs/$fac.log

And finally, the remote script which is executed by the updatec series of

[root at minion client_install]# cat totinf

uptime|sed -e 's/.* load/load/' -e 's/\,//g'|cut -d" " -f3
t=`w|grep tmr|grep auto|wc -l`
u=`w|grep epac.sh|wc -l`
tu=`expr "$t" + "$u"`
echo $tu
s=`date '+%d'`
x=`tail -32 "/u/server/log/tal$s.log"|awk '{print $2 ;}'|grep 000|wc -l|awk
'{print $1}'`
echo "$x"
tout2=`cat "/u/server/log/tal$s.log"|awk '{print $2 ;}'|grep 000|wc -l|awk
'{print $1}'`
echo "$tout2"
time=`/bin/date` ; echo "$time"
cpu=`hw -r cpu|grep performs` ; echo "$cpu"
uptim=`w -t`;echo "$uptim"
cmv=`cat /u/server/motd|grep VERSION`; echo "$cmv"

    Does anyone have any suggestions to a better means to compile the data I
require? Also, feel free to critique my scripts, but please keep in mind I
do not claim to be a good scripter.The main restraint I have is, any data
"pushed" into the databases must be less than 2 minutes from the last update
or the data becomes NaN, invalid "not a number." I had problems originally
when I had all the remote systems checked by a single script, i.e. not
finishing in less than 2 minutes (caused by a number various issues.)
    My goal is to: 
                         a. retrieve data from remote hosts
                    b. add data to rrd's and .log files in less than 2
minute increments (accounting for possible timeouts, due to network issues
etc., for 40+ remote systems.)
                    c. graph all remote systems every minute
                         d. generate minimal load on my linux box, as I
would like to run Nagios or Netsaint on this system as well.
    Just in case my crontab entry isn't configured correctly, here it is - 
            0-59 * * * * root run-parts /etc/cron.minute #execute all files
in /etc/cron.minute 0-59 minutes every hour of every day of every month..
        If you made it this far, I must commend you, I didn't plan for this
e-mail to become so lengthy.
Thanks a ton,
Eric Collins
"The two enemies of the people are criminals and government, so let us tie
the second down with the chains of the constitution so the second will not
become the legalized version of the first."
-Thomas Jefferson


Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi

More information about the rrd-users mailing list