From 36ac271c5d7a6c3d593f3bbffec07c692480e7c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Tue, 20 Nov 2012 11:09:59 -0800 Subject: [PATCH] snmp__if_combined: don't use cdef to generate the final value. This actually simplifies the code, and avoids extra work on the master side for no reason. --- plugins/snmp/snmp__if_combined | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/plugins/snmp/snmp__if_combined b/plugins/snmp/snmp__if_combined index f449f545..222d3513 100755 --- a/plugins/snmp/snmp__if_combined +++ b/plugins/snmp/snmp__if_combined @@ -613,10 +613,8 @@ END print <{$if}->{ifHCInOctets} || - $snmpinfo->{$if}->{ifInOctets})) { - print "recv.value $response\n"; - } else { - # No response... - print "recv.value U\n"; - } + $response = $snmpinfoX->{$if}->{ifHCInOctets} || $snmpinfo->{$if}->{ifInOctets}; + printf("recv.value %s\n", defined($response) ? ($response * 8) : "U"); - if (defined ($response = $snmpinfoX->{$if}->{ifHCOutOctets} || - $snmpinfo->{$if}->{ifOutOctets})) { - print "send.value $response\n"; - } else { - # No response... - print "send.value U\n"; - } + $response = $snmpinfoX->{$if}->{ifHCOutOctets} || $snmpinfo->{$if}->{ifOutOctets}; + printf("send.value %s\n", defined($response) ? ($response * 8) : "U"); if_errors: