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:
parent
381101d222
commit
0553d6c2d0
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue