--- experimental/reports/queuegraphing/watch.pl 2001/10/21 16:52:41 1.1 +++ experimental/reports/queuegraphing/watch.pl 2001/10/21 18:57:40 1.2 @@ -100,7 +100,17 @@ while(1) { &makerrd($hash, $i, $date, $name); } my($size) = $xmlhash{"packet.queue.attributes.queue$i"}; - my($cmd) = "rrdtool update $hash\_$i.rrd $date:$size:$total"; + my($cmd); + if($size eq "[deleted]") { + $cmd = "rm -f $hash\_$i.rrd $hash*.png"; + my($rrdcount) = `ls | grep $hash\_\\*.rrd | wc -l`; + if($rrdcount == 0) { + $cmd = $cmd . " && rm -f $hash.def"; + } + } + else { + $cmd = "rrdtool update $hash\_$i.rrd $date:$size:$total"; + } print `$cmd`; print "$cmd\n"; ++$i; @@ -109,32 +119,9 @@ while(1) { else { print "SKIPPED: valid xml, but not a queueStat packet"; } - #if($response =~ /^<\/queue><\/packet>$/) { - # print "DATE: $1 HASH: $3 SIZE0: $4 TOTAL: $5 MAX: $6\n"; - # if( ! -f "$3.rrd" ) { - # print "making new database for $3\n"; - # &makerrd($3, $1, $2); - # } - # my($cmd) = "rrdtool update $3.rrd $1:$4:$5"; - # print `$cmd`; - #} - #else { - # print "SKIPPED: $response"; - #} } exit 0; - -# - -#packet.attributes.name == realtimeclients TCPHandler:myrtle.ukc.ac.uk -#packet.queue.attributes.total == 13 -#packet.queue.attributes.maxSize == 1000 -#packet.queue.attributes.queue0 == 0 -#packet.queue.attributes.queue1 == 0 -#packet.attributes.hashCode == 4575504 -#packet.attributes.date == 1003614252 -#packet.attributes.type == queueStat sub makerrd() { my($name, $queuenum, $start, $comment) = @_;