From 54bea0ba4a9db77bebb6bc76ef8db43106a99b29 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Fri, 20 Sep 2013 15:19:04 +0200 Subject: count interfaces and port channel --- check_snmp_switch_traffic.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/check_snmp_switch_traffic.pl b/check_snmp_switch_traffic.pl index 2b832be..b38dc58 100755 --- a/check_snmp_switch_traffic.pl +++ b/check_snmp_switch_traffic.pl @@ -131,7 +131,9 @@ my $IFACES = get_ifaces($session); get_info($session, $IFACES); $session->close(); -print "SNMP OK |"; +my $channel = grep { $IFACES->{$_}{'name'} =~ /^ch/} keys %{ $IFACES }; +my $if = grep { $IFACES->{$_}{'name'} !~ /^ch/} keys %{ $IFACES }; +print "SNMP OK - $if interfaces, $channel port channel |"; foreach my $key (sort {$a <=> $b} keys %{ $IFACES }) { printf " %s(in)=%sc; %s(out)=%sc;", $IFACES->{$key}{'name'}, $IFACES->{$key}{'in'}, $IFACES->{$key}{'name'}, $IFACES->{$key}{'out'}; } -- cgit v1.2.3-1-g7c22