From 20214655e08e1aff42e6f1a12fd7467331dd7d6a Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Mon, 1 Oct 2012 11:29:24 +0200 Subject: [PATCH] check_junos_bgp: Fixed check for non-existing attributes. --- check_junos_bgp.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; }