diff --git a/check_junos_bgp.pl b/check_junos_bgp.pl index 6909fba..9c0c0e2 100755 --- a/check_junos_bgp.pl +++ b/check_junos_bgp.pl @@ -515,9 +515,9 @@ sub get_peer_element } $e = $peer->getElementsByTagName($elem); - if (! $e) { + if ((! $e) || (! $e->item(0))) { print STDERR "Attribute '$elem' not found for peer.\n"; - verbose(3, "Element was: " . Dumper($elem)); + verbose(3, "Peer was: " . Dumper($peer)); return; }