PNP4Nagios check_snmp

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
sut1ee
Posts: 4
Joined: Wed Jun 26, 2019 3:48 pm

PNP4Nagios check_snmp

Post 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?
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: PNP4Nagios check_snmp

Post 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.
Former Nagios employee
https://www.mcapra.com/
sut1ee
Posts: 4
Joined: Wed Jun 26, 2019 3:48 pm

Re: PNP4Nagios check_snmp

Post 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%
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: PNP4Nagios check_snmp

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
sut1ee
Posts: 4
Joined: Wed Jun 26, 2019 3:48 pm

Re: PNP4Nagios check_snmp

Post 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
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: PNP4Nagios check_snmp

Post 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/n ... e-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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
sut1ee
Posts: 4
Joined: Wed Jun 26, 2019 3:48 pm

Re: PNP4Nagios check_snmp

Post 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/n ... e-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!
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: PNP4Nagios check_snmp

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked