1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-22 02:51:03 +00:00

Fix undef string compare.

Guard against $type not defined.
This commit is contained in:
Samuel Smith 2016-01-14 21:18:59 -06:00
parent 381101d222
commit 0553d6c2d0

View file

@ -81,7 +81,7 @@ my( $name, $id1, $id2, $type, $rate, $parent);
for( my $x = 0; $x < scalar(@class); $x++ ) {
if($class[$x] =~ m/^class/i ) {
( $name, $id1, $id2, $type, $parent) = ( $class[$x] =~ m/^class\s+(\w+)\s+(\d+):(\d+)\s+(\w+)\s([^\s]+)/i );
if($type eq "parent") {
if($type && $type eq "parent") {
$x++;
( $rate ) = ( $class[$x] =~ m/Sent\s+(\d+)\s+/i );
$handle = "$name"."${id1}_${id2}";
@ -168,4 +168,4 @@ foreach my $key (sort by_handle keys %queues) {
print $queues{$key}->{queue},$queues{$key}->{handle}, ".value ",$queues{$key}->{sent}, "\n";
}
#
# vim:syntax=perl
# vim:syntax=perl