From a14dae1e6277078cf77be32010b835e4f2879246 Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Wed, 22 Aug 2012 08:36:42 +0200 Subject: [PATCH] check_junos: Include description of down interfaces in output. --- check_junos.pl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/check_junos.pl b/check_junos.pl index 1915f17..3d2f13e 100755 --- a/check_junos.pl +++ b/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"; } } }