Browse Source

check_junos: Include description of down interfaces in output.

Sebastian Harl 12 năm trước cách đây
mục cha
commit
a14dae1e62
1 tập tin đã thay đổi với 7 bổ sung2 xóa
  1. 7 2
      check_junos.pl

+ 7 - 2
check_junos.pl

@@ -276,11 +276,15 @@ sub check_interfaces
 
 	foreach my $iface (@interfaces) {
 		my $name = $plugin->get_query_object_value($iface, 'name');
+		my $desc = $plugin->get_query_object_value($iface, 'description');
 		my $status = check_interface($plugin, $iface, $opts, @targets);
 
+		my $tmp;
+
 		if ($status == 0) {
 			++$down_count;
-			push @down_ifaces, $name;
+			$tmp = $name . ($desc ? " ($desc)" : "");
+			push @down_ifaces, $tmp;
 		}
 
 		if ($status <= 0) {
@@ -313,7 +317,8 @@ sub check_interfaces
 			foreach my $phy_iface (@phy_interfaces) {
 				if (check_interface($plugin, $phy_iface, {}, $phy_name) == 0) {
 					++$phys_down_count;
-					push @phys_down_ifaces, "$name -> $phy_name";
+					$tmp = $name . ($desc ? " ($desc)" : "");
+					push @phys_down_ifaces, "$tmp -> $phy_name";
 				}
 			}
 		}