| 85 |
|
if($err) { |
| 86 |
|
print "SKIPPED (bad xml): $response"; |
| 87 |
|
} |
| 88 |
< |
#foreach my $key (keys %xmlhash) { |
| 89 |
< |
# print "$key == $xmlhash{$key}\n"; |
| 90 |
< |
#} |
| 88 |
> |
## -- mental note, think about ordering checks for optimal speed ;) |
| 89 |
> |
# take a look to see if we have a shutdown packet... |
| 90 |
> |
if(defined($xmlhash{"packet.attributes.shutdown"}) && $xmlhash{"packet.attributes.shutdown"} eq "true") { |
| 91 |
> |
my($hash) = $xmlhash{"packet.attributes.hashCode"}; |
| 92 |
> |
my($cmd) = "rm -f $hash\_*.rrd $hash*.png $hash.def"; |
| 93 |
> |
print `$cmd`; |
| 94 |
> |
print "$cmd\n"; |
| 95 |
> |
next; |
| 96 |
> |
} |
| 97 |
|
if($xmlhash{"packet.attributes.type"} eq "queueStat") { |
| 98 |
|
my($hash) = $xmlhash{"packet.attributes.hashCode"}; |
| 99 |
|
my($date) = $xmlhash{"packet.attributes.date"}; |
| 107 |
|
} |
| 108 |
|
my($size) = $xmlhash{"packet.queue.attributes.queue$i"}; |
| 109 |
|
my($cmd); |
| 110 |
+ |
# see if the queue has been removed |
| 111 |
|
if($size eq "[deleted]") { |
| 112 |
< |
$cmd = "rm -f $hash\_$i.rrd $hash*.png"; |
| 112 |
> |
$cmd = "rm -f $hash\_$i.rrd"; |
| 113 |
> |
# are there any other rrd's left? if not, cleanup! |
| 114 |
|
my($rrdcount) = `ls | grep $hash\_\\*.rrd | wc -l`; |
| 115 |
|
if($rrdcount == 0) { |
| 116 |
< |
$cmd = $cmd . " && rm -f $hash.def"; |
| 116 |
> |
$cmd = $cmd . " && rm -f $hash.def $hash*.png"; |
| 117 |
|
} |
| 118 |
|
} |
| 119 |
|
else { |