Browse Source

check_junos_bgp: Fixed check for non-existing attributes.

Sebastian Harl 12 years ago
parent
commit
20214655e0
1 changed files with 2 additions and 2 deletions
  1. 2 2
      check_junos_bgp.pl

+ 2 - 2
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;
 	}