Page 1 of 1

PNP4Nagios check_snmp

PostPosted: Wed Jun 26, 2019 3:56 pm
by sut1ee
Hello!

I have got a problem with pnp4nagios and check_snmp command.

check_snmp!-P 3 -L authPriv -a SHA -x DES -U <username> -A <password> -X <password> -o .1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0 -l "CPU Usage" -u% -w 65 -c 85. If I use that command, pnp4nagios won't create a graph, but if I remove -w 65 -c 85 line from check command, the pnp4nagios will work and start create a graph.

So what can I do? What I do wrong?

Re: PNP4Nagios check_snmp

PostPosted: Thu Jun 27, 2019 2:06 pm
by mcapra
Can you share the full outputs of the commands, executed from the CLI of your Nagios Core machine? Preferably, with the -v/--verbose flags provided with check_snmp.

If you're using the standard file system paths for the nagios-plugins suite, and the default commanddefinition supplied for check_snmp, those commands might look something like this:
Code: Select all
/usr/local/nagios/libexec/check_snmp -H <hostaddress> -P 3 -L authPriv -a SHA -x DES -U <username> -A <password> -X <password> -o .1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0 -l "CPU Usage" -u% -w 65 -c 85 -v

/usr/local/nagios/libexec/check_snmp -H <hostaddress> -P 3 -L authPriv -a SHA -x DES -U <username> -A <password> -X <password> -o .1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0 -l "CPU Usage" -u% -v


Be sure to replace <hostaddress> with a particular host that you're checking via SNMP. Also be sure to sanitize any sensitive information when sharing the output -- stuff like usernames, passwords, hostnames, etc.

Re: PNP4Nagios check_snmp

PostPosted: Thu Jun 27, 2019 3:43 pm
by sut1ee
mcapra wrote:Can you share the full outputs of the commands, executed from the CLI of your Nagios Core machine? Preferably, with the -v/--verbose flags provided with check_snmp.

If you're using the standard file system paths for the nagios-plugins suite, and the default commanddefinition supplied for check_snmp, those commands might look something like this:
Code: Select all
/usr/local/nagios/libexec/check_snmp -H <hostaddress> -P 3 -L authPriv -a SHA -x DES -U <username> -A <password> -X <password> -o .1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0 -l "CPU Usage" -u% -w 65 -c 85 -v

/usr/local/nagios/libexec/check_snmp -H <hostaddress> -P 3 -L authPriv -a SHA -x DES -U <username> -A <password> -X <password> -o .1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0 -l "CPU Usage" -u% -v


Be sure to replace <hostaddress> with a particular host that you're checking via SNMP. Also be sure to sanitize any sensitive information when sharing the output -- stuff like usernames, passwords, hostnames, etc.


I tried both command.
First output: /usr/bin/snmpget -Le -t 3 -r 5 -m '' -v 3 [authpriv] 172.20.0.26:161 .1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0
iso.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0 = INTEGER: 2
SNMP OK - CPU Usage 2 % | 'CPU Usage'=2;65;85%;65;85;

Second output:
/usr/bin/snmpget -Le -t 3 -r 5 -m '' -v 3 [authpriv] 172.20.0.26:161 .1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0
iso.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0 = INTEGER: 33
SNMP OK - CPU Usage 33 % | 'CPU Usage'=33%

Re: PNP4Nagios check_snmp

PostPosted: Fri Jun 28, 2019 11:58 am
by tgriep
One thing to note, if you edit an existing command and that changes the performance data output, that will cause the graphs to not add the new data to the files and the graph will not update.
What you need to do is to delete the existing .rrd file and the .xml file for the check after the change to the command was dome so the system will recreate the rd file with the new datapoints and start to display the data.

Re: PNP4Nagios check_snmp

PostPosted: Sun Jul 07, 2019 10:41 am
by sut1ee
tgriep wrote:One thing to note, if you edit an existing command and that changes the performance data output, that will cause the graphs to not add the new data to the files and the graph will not update.
What you need to do is to delete the existing .rrd file and the .xml file for the check after the change to the command was dome so the system will recreate the rd file with the new datapoints and start to display the data.


I did it, but the problem is same.
check_command check_snmp!-P 3 -L authPriv -a SHA -x DES -U username -A password -X password -o .1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0 -l "CPU Usage" -u% -w 65 -c 85 with this command won't create CPU Usage RRD, only _HOST_ RRD, but I use check_command check_snmp!-P 3 -L authPriv -a SHA -x DES -U username -A password -X password -o .1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0 -l "CPU Usage" -u% without warning and critical, the tool create and graphing, and i see CPU Usage RRD file in /usr/local/pnp4nagios/var/perfdata/hostname directory

Re: PNP4Nagios check_snmp

PostPosted: Mon Jul 08, 2019 9:02 am
by tgriep
Are you running version 2.2.1 of the plugin? To check that, run the following.
Code: Select all
/usr/local/nagios/libexec/check_snmp -V

If not, try upgrading the plugin using the source install.
https://support.nagios.com/kb/article/nagios-plugins-installing-nagios-plugins-from-source-569.html
Also, have you checked the npcd.log file and the perfdata.log files for any messages when the plugin runs and doesn't create the rrd file?

Re: PNP4Nagios check_snmp

PostPosted: Mon Jul 08, 2019 9:19 am
by sut1ee
tgriep wrote:Are you running version 2.2.1 of the plugin? To check that, run the following.
Code: Select all
/usr/local/nagios/libexec/check_snmp -V

If not, try upgrading the plugin using the source install.
https://support.nagios.com/kb/article/nagios-plugins-installing-nagios-plugins-from-source-569.html
Also, have you checked the npcd.log file and the perfdata.log files for any messages when the plugin runs and doesn't create the rrd file?


It works! I used an older version. I updated nagios-plugins, and the graph started work with check_snmp!-P 3 -L authPriv -a SHA -x DES -U <username> -A <password> -X <password> -o .1.3.6.1.4.1.11.2.14.11.5.1.9.6.1.0 -l "CPU Usage" -u% -w 65 -c 85.

Thank you very much your help!

Re: PNP4Nagios check_snmp

PostPosted: Mon Jul 08, 2019 9:23 am
by tgriep
Your very welcome. Glad to help.
I'll close and lock the post as solved but feel free to open a new one for any other questions.