diff --git a/plugins/snmp/snmp__if_combined b/plugins/snmp/snmp__if_combined index 222d3513..15bb7e8d 100755 --- a/plugins/snmp/snmp__if_combined +++ b/plugins/snmp/snmp__if_combined @@ -598,7 +598,7 @@ END print "graph_order"; foreach my $if (sort {$a <=> $b} keys %{$snmpinfo}) { - print " recv$if=snmp_if_combined_err.$if.recv send$if=snmp_if_combined_err.$if.send"; + print " recv$if=snmp_if_combined_err.$if.total_in send$if=snmp_if_combined_err.$if.total_out"; } print "\n"; @@ -686,14 +686,33 @@ graph_args --base 1000 graph_vlabel errors in (-) / out (+) per \${graph_period} graph_category network -recv.label recv -recv.type DERIVE -recv.graph no -recv.min 0 -send.label Errors -send.type DERIVE -send.negative recv -send.min 0 +errors_in.label $alias +errors_in.graph no +errors_in.label recv +errors_in.type DERIVE +errors_in.min 0 +errors_out.label Errors +errors_out.negative errors_in +errors_out.type DERIVE +errors_out.min 0 + +discards_in.label $alias +discards_in.graph no +discards_in.type DERIVE +discards_in.min 0 +discards_out.label Discards +discards_out.negative discards_in +discards_out.type DERIVE +discards_out.min 0 + +total_in.label $alias +total_in.graph no +total_in.type DERIVE +total_in.min 0 +total_out.label $alias +total_out.graph no +total_out.type DERIVE +total_out.min 0 END } @@ -729,24 +748,39 @@ sub do_fetch_if { print "multigraph snmp_if_combined_err.$if\n"; if ($status == 2) { - print "recv.value U\n"; - print "send.value U\n"; - print "send.extinfo This interface is down\n"; + print <{$if}->{ifInErrors} || 0 ) + - ( $snmpinfo->{$if}->{ifInDiscards} || 0 ); + $errors = $snmpinfo->{$if}->{ifInErrors}; + $discards = $snmpinfo->{$if}->{ifInDiscards}; + printf("errors_in %s\n". + "discards_in %s\n". + "total_in %s\n", + $errors || "U", + $discards || "U", + ($errors || 0) + ($discards || 0) + ); - print "recv.value $response\n"; - - $response = ( $snmpinfo->{$if}->{ifOutErrors} || 0 ) + - ( $snmpinfo->{$if}->{ifOutDiscards} || 0 ); - - print "send.value $response\n"; + $errors = $snmpinfo->{$if}->{ifOutErrors}; + $discards = $snmpinfo->{$if}->{ifOutDiscards}; + printf("errors_out %s\n". + "discards_out %s\n". + "total_out %s\n", + $errors || "U", + $discards || "U", + ($errors || 0) + ($discards || 0) + ); } - sub do_config { my ($host,undef,$version) = Munin::Plugin::SNMP->config_session();