--- projects/cms/source/reports/rrdgraphing/watch.pl 2004/08/01 10:40:32 1.8 +++ projects/cms/source/reports/rrdgraphing/watch.pl 2005/02/10 17:35:58 1.9 @@ -28,15 +28,11 @@ # the i-scream server and collecting data. # # $Author: tdb $ -# $Id: watch.pl,v 1.8 2004/08/01 10:40:32 tdb Exp $ +# $Id: watch.pl,v 1.9 2005/02/10 17:35:58 tdb Exp $ #------------------------------------------------------------ -BEGIN { - push (@INC, "/usr/local/packages/rrdtool/lib/perl5/site_perl/5.8.2/sun4-solaris"); -} +my($version) = '$Id: watch.pl,v 1.9 2005/02/10 17:35:58 tdb Exp $'; -my($version) = '$Id: watch.pl,v 1.8 2004/08/01 10:40:32 tdb Exp $'; - $| = 1; use strict; @@ -47,10 +43,10 @@ use RRDs; # define variables that will be read from the config # nb. keep this insync with the config file! -use vars qw{ - $imgdir $rrddir +use vars qw{ + $imgdir $rrddir $maxrrdage $maximgage $deleterrds $deleteimgs - $hex_slash $hex_underscore + $hex_slash $hex_underscore $hex_space $hex_colon $hex_bslash $rrdstep $retry_wait $verbose $quiet }; @@ -260,6 +256,10 @@ sub processdata() { ); &updaterrd($machine, "cpu", $date, $rrdstep, \%xmlhash, @data); + # uptime + @data = ( "packet.os.uptime:uptime:GAUGE" ); + &updaterrd($machine, "uptime", $date, $rrdstep, \%xmlhash, @data); + # mem @data = ( "packet.memory.free:free:GAUGE", "packet.memory.total:total:GAUGE", @@ -306,6 +306,9 @@ sub processdata() { my($mount) = $xmlhash{"packet.disk.p$i.attributes.mount"}; $mount =~ s/_/$hex_underscore/g; $mount =~ s/\//$hex_slash/g; + $mount =~ s/\\/$hex_bslash/g; + $mount =~ s/ /$hex_space/g; + $mount =~ s/:/$hex_colon/g; @data = ( "packet.disk.p$i.attributes.total:total:GAUGE", "packet.disk.p$i.attributes.used:used:GAUGE", "packet.disk.p$i.attributes.totalinodes:totalinodes:GAUGE", @@ -319,6 +322,11 @@ sub processdata() { $i = 0; while(defined $xmlhash{"packet.diskio.p$i.attributes.name"}) { my($name) = $xmlhash{"packet.diskio.p$i.attributes.name"}; + $name =~ s/_/$hex_underscore/g; + $name =~ s/\//$hex_slash/g; + $name =~ s/\\/$hex_bslash/g; + $name =~ s/ /$hex_space/g; + $name =~ s/:/$hex_colon/g; @data = ( "packet.diskio.p$i.attributes.rbytes:rbytes:GAUGE", "packet.diskio.p$i.attributes.wbytes:wbytes:GAUGE", ); @@ -330,6 +338,11 @@ sub processdata() { $i = 0; while(defined $xmlhash{"packet.net.p$i.attributes.name"}) { my($name) = $xmlhash{"packet.net.p$i.attributes.name"}; + $name =~ s/_/$hex_underscore/g; + $name =~ s/\//$hex_slash/g; + $name =~ s/\\/$hex_bslash/g; + $name =~ s/ /$hex_space/g; + $name =~ s/:/$hex_colon/g; @data = ( "packet.net.p$i.attributes.rx:rx:GAUGE", "packet.net.p$i.attributes.tx:tx:GAUGE", ); @@ -341,7 +354,7 @@ sub processdata() { $i = 0; while(defined $xmlhash{"packet.mailq.p$i.attributes.name"}) { my($name) = $xmlhash{"packet.mailq.p$i.attributes.name"}; - $name =~ s/\s+//g; + $name =~ s/\s+//g; @data = ( "packet.mailq.p$i.attributes.size:size:GAUGE", ); &updaterrd($machine, "mailq-$name", $date, $rrdstep, \%xmlhash, @data);