Skip to content

Commit

Permalink
bugfix lldp
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Krogloth committed Oct 1, 2019
1 parent 1d53ea6 commit 32b377f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions check_cdot_lldp.pl
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,16 @@ sub Error {
exit 3;
}

if ($output->child_get_string("num-records") eq "0"){
last;
}
my $count = 0;

unless ($output->child_get_string("num-records") eq "0"){

my $heads = $output->child_get( "attributes-list" );
my @result = $heads->children_get();
my $heads = $output->child_get( "attributes-list" );
my @result = $heads->children_get();

$count = scalar @result;

my $count = scalar @result;
}

unless($count eq "0"){
print "CRITICAL: lldp not enabled on $count nodes\n";
Expand Down

0 comments on commit 32b377f

Please sign in to comment.