check_iftraffic64.pl https://exchange.nagios.org/directory/P ... 64/details
This plugin checks the traffic using SNMP, and do the job fine but I have a problem when shows the results in the WEB-GUI which I could not resolv.
As it can see in the image, the result is "OK" but the status is "UNKNOWN". I got in touch with the developer but he could not figure out what the problem was. I kept doing some researches and debugging but I do not know what to do, so I ask for your help. I got the same result in three Nagios installations (one of them a clean one).
Debug info:
Code: Select all
[1483644257.422936] [016.1] [pid=21070] Embedded Perl ran /usr/lib/nagios/plugins/check_iftraffic64.pl: return code=3, plugin output=OK - Average IN: 9.71KB (0.01%), Average OUT: 11.76KB (0.01%)Total RX: 1.06GBytes, Total TX: 417.88MBytes
|inUsage=0.01%;85;98 outUsage=0.01%;85;98 inBandwidth=9712.38B
|outBandwidth=11759.16B inAbsolut=1056798111c outAbsolut=417877276c\n
If I run the plugin from terminal and I do "echo $?" it returns code 0
I also created a perl file with:
Code: Select all
#!/usr/bin/perl -w
exit $STATUS_CODE{'OK'};
My command definition:
Code: Select all
define command{
command_name check_iftraffic64
command_line $USER1$/check_iftraffic64.pl -H $HOSTADDRESS$ $ARG1$
}
define service {
use generic-service
host hostname
service_description Check Traffic
check_command check_iftraffic64!-C nagios -i 11 -w 85 -c 98
}
Nagios: Core 3.5.1 (from Debian Repository)
Apache: 2.4 (from Debian Repository)