--- projects/cms/source/reports/rrdgraphing/watch.pl 2002/05/21 15:01:43 1.3 +++ projects/cms/source/reports/rrdgraphing/watch.pl 2004/03/04 11:27:30 1.7 @@ -2,6 +2,7 @@ # # i-scream central monitoring system +# http://www.i-scream.org.uk # Copyright (C) 2000-2002 i-scream # # This program is free software; you can redistribute it and/or @@ -27,11 +28,15 @@ # the i-scream server and collecting data. # # $Author: tdb $ -# $Id: watch.pl,v 1.3 2002/05/21 15:01:43 tdb Exp $ +# $Id: watch.pl,v 1.7 2004/03/04 11:27:30 tdb Exp $ #------------------------------------------------------------ -my($version) = '$Id: watch.pl,v 1.3 2002/05/21 15:01:43 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.7 2004/03/04 11:27:30 tdb Exp $'; + $| = 1; use strict; @@ -258,6 +263,7 @@ sub processdata() { # mem @data = ( "packet.memory.free:free:GAUGE", "packet.memory.total:total:GAUGE", + "packet.memory.cache:cache:GAUGE", ); &updaterrd($machine, "mem", $date, $rrdstep, \%xmlhash, @data); @@ -287,18 +293,59 @@ sub processdata() { @data = ( "packet.users.count:count:GAUGE", ); &updaterrd($machine, "users", $date, $rrdstep, \%xmlhash, @data); - + + # paging + @data = ( "packet.pages.pageins:pageins:GAUGE", + "packet.pages.pageouts:pageouts:GAUGE", + ); + &updaterrd($machine, "paging", $date, $rrdstep, \%xmlhash, @data); + # disk my($i) = 0; while(defined $xmlhash{"packet.disk.p$i.attributes.mount"}) { my($mount) = $xmlhash{"packet.disk.p$i.attributes.mount"}; $mount =~ s/_/$hex_underscore/g; $mount =~ s/\//$hex_slash/g; - @data = ( "packet.disk.p$i.attributes.kbytes:kbytes:GAUGE", + @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", + "packet.disk.p$i.attributes.freeinodes:freeinodes:GAUGE", ); &updaterrd($machine, "disk-$mount", $date, $rrdstep, \%xmlhash, @data); ++$i; + } + + # diskio + $i = 0; + while(defined $xmlhash{"packet.diskio.p$i.attributes.name"}) { + my($name) = $xmlhash{"packet.diskio.p$i.attributes.name"}; + @data = ( "packet.diskio.p$i.attributes.rbytes:rbytes:GAUGE", + "packet.diskio.p$i.attributes.wbytes:wbytes:GAUGE", + ); + &updaterrd($machine, "diskio-$name", $date, $rrdstep, \%xmlhash, @data); + ++$i + } + + # net + $i = 0; + while(defined $xmlhash{"packet.net.p$i.attributes.name"}) { + my($name) = $xmlhash{"packet.net.p$i.attributes.name"}; + @data = ( "packet.net.p$i.attributes.rx:rx:GAUGE", + "packet.net.p$i.attributes.tx:tx:GAUGE", + ); + &updaterrd($machine, "net-$name", $date, $rrdstep, \%xmlhash, @data); + ++$i + } + + # mailq + $i = 0; + while(defined $xmlhash{"packet.mailq.p$i.attributes.name"}) { + my($name) = $xmlhash{"packet.mailq.p$i.attributes.name"}; + $name =~ s/\s+//g; + @data = ( "packet.mailq.p$i.attributes.size:size:GAUGE", + ); + &updaterrd($machine, "mailq-$name", $date, $rrdstep, \%xmlhash, @data); + ++$i } }