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?
PNP4Nagios check_snmp
-
- Posts: 3739
- Joined: Thu May 05, 2016 3:54 pm
Re: PNP4Nagios check_snmp
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:
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.
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
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
-
- Posts: 4
- Joined: Wed Jun 26, 2019 3:48 pm
Re: PNP4Nagios check_snmp
I tried both command.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: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.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
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%
-
- Madmin
- Posts: 9190
- Joined: Thu Oct 30, 2014 9:02 am
Re: PNP4Nagios check_snmp
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.
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!
-
- Posts: 4
- Joined: Wed Jun 26, 2019 3:48 pm
Re: PNP4Nagios check_snmp
I did it, but the problem is same.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.
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
-
- Madmin
- Posts: 9190
- Joined: Thu Oct 30, 2014 9:02 am
Re: PNP4Nagios check_snmp
Are you running version 2.2.1 of the plugin? To check that, run the following.
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?
Code: Select all
/usr/local/nagios/libexec/check_snmp -V
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!
-
- Posts: 4
- Joined: Wed Jun 26, 2019 3:48 pm
Re: PNP4Nagios check_snmp
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.tgriep wrote:Are you running version 2.2.1 of the plugin? To check that, run the following.If not, try upgrading the plugin using the source install.Code: Select all
/usr/local/nagios/libexec/check_snmp -V
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?
Thank you very much your help!
-
- Madmin
- Posts: 9190
- Joined: Thu Oct 30, 2014 9:02 am
Re: PNP4Nagios check_snmp
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.
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!