PNP4Nagios check_snmp

An open discussion forum for obtaining help with Nagios Core. Nagios Core users of all experience levels are welcome here. Subforum have been created for the discussion of Nagios Core and Nagios Plugin development.

NOTE: The SourceForge.net mailing lists have been deprecated in favor of this forum in order to expedite support and provide additional features not available on the old mailing list.

PNP4Nagios check_snmp

Postby sut1ee » Wed Jun 26, 2019 3:56 pm

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?
sut1ee
 
Posts: 4
Joined: Wed Jun 26, 2019 3:48 pm

Re: PNP4Nagios check_snmp

Postby mcapra » Thu Jun 27, 2019 2:06 pm

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
http://www.mcapra.com/
User avatar
mcapra
 
Posts: 3587
Joined: Thu May 05, 2016 3:54 pm

Re: PNP4Nagios check_snmp

Postby sut1ee » Thu Jun 27, 2019 3:43 pm

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%
sut1ee
 
Posts: 4
Joined: Wed Jun 26, 2019 3:48 pm

Re: PNP4Nagios check_snmp

Postby tgriep » Fri Jun 28, 2019 11:58 am

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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 8429
Joined: Thu Oct 30, 2014 9:02 am

Re: PNP4Nagios check_snmp

Postby sut1ee » Sun Jul 07, 2019 10:41 am

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
sut1ee
 
Posts: 4
Joined: Wed Jun 26, 2019 3:48 pm

Re: PNP4Nagios check_snmp

Postby tgriep » Mon Jul 08, 2019 9:02 am

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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 8429
Joined: Thu Oct 30, 2014 9:02 am

Re: PNP4Nagios check_snmp

Postby sut1ee » Mon Jul 08, 2019 9:19 am

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!
sut1ee
 
Posts: 4
Joined: Wed Jun 26, 2019 3:48 pm

Re: PNP4Nagios check_snmp

Postby tgriep » Mon Jul 08, 2019 9:23 am

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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
tgriep
Madmin
 
Posts: 8429
Joined: Thu Oct 30, 2014 9:02 am


Return to Nagios Core

Who is online

Users browsing this forum: No registered users and 20 guests