--- projects/cms/source/reports/rrdgraphing/watch.pl 2004/08/01 10:40:32 1.8 +++ projects/cms/source/reports/rrdgraphing/watch.pl 2006/11/23 16:37:44 1.13 @@ -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.13 2006/11/23 16:37:44 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.13 2006/11/23 16:37:44 tdb Exp $'; -my($version) = '$Id: watch.pl,v 1.8 2004/08/01 10:40:32 tdb Exp $'; - $| = 1; use strict; @@ -47,10 +43,11 @@ 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 $imgwidth $imgheight $rrddir $maxrrdage $maximgage $deleterrds $deleteimgs - $hex_slash $hex_underscore + $hex_slash $hex_underscore $hex_space $hex_colon $hex_bslash $hex_rbracket + $hex_lbracket $hex_plus $hex_hash $rrdstep $retry_wait $verbose $quiet }; @@ -260,6 +257,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 +307,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 +323,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 +339,15 @@ 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; + $name =~ s/\(/$hex_lbracket/g; + $name =~ s/\)/$hex_rbracket/g; + $name =~ s/\+/$hex_plus/g; + $name =~ s/#/$hex_hash/g; @data = ( "packet.net.p$i.attributes.rx:rx:GAUGE", "packet.net.p$i.attributes.tx:tx:GAUGE", ); @@ -341,7 +359,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);