I'm creating a host-check command using check_snmp. I get the host name oid and attempt a string match. When I run it within nagiosxi it doesn't work but when I run it outside of nagiosxi in a terminal it does. What's the difference?
in nagiosxi
[nagios@z1-da1-c1-nms-1 ~]$ /usr/local/nagios/libexec/check_snmp -H x.x.x.x -o .1.3.6.1.2.1.1.5.0 -C public -s '"etm-1.tango-networks.com"'
SNMP CRITICAL - *"etm-1.tango-networks.com"* |
I copy then paste into a terminal
[nagios@z1-da1-c1-nms-1 libexec]$ /usr/local/nagios/libexec/check_snmp -H x.x.x.x -o .1.3.6.1.2.1.1.5.0 -C public -s '"etm-1.tango-networks.com"'
SNMP OK - "etm-1.tango-networks.com" |
[nagios@z1-da1-c1-nms-1 libexec]$
So I run with -v
nagiosXI
[nagios@z1-da1-c1-nms-1 ~]$ /usr/local/nagios/libexec/check_snmp -H x.x.x.x -o .1.3.6.1.2.1.1.5.0 -C public -s '"etm-1.tango-networks.com"' -v
/bin/snmpget -Le -t 3 -r 5 -m '' -v 1 [context] [authpriv] x.x.x.x .1.3.6.1.2.1.1.5.0
iso.3.6.1.2.1.1.5.0 = STRING: "etm-1.tango-networks.com"
SNMP CRITICAL - *"etm-1.tango-networks.com"* |
command line
[nagios@z1-da1-c1-nms-1 libexec]$ /usr/local/nagios/libexec/check_snmp -H x.x.x.x -o .1.3.6.1.2.1.1.5.0 -C public -s '"etm-1.tango-networks.com"' -v
/bin/snmpget -Le -t 3 -r 5 -m '' -v 1 [context] [authpriv] x.x.x.x .1.3.6.1.2.1.1.5.0
iso.3.6.1.2.1.1.5.0 = STRING: "etm-1.tango-networks.com"
SNMP OK - "etm-1.tango-networks.com" |
[nagios@z1-da1-c1-nms-1 libexec]$
same exact command with different results. What am I missing?
check_snmp problems
Re: check_snmp problems
It looks like the error is from the "Run Check Command" button found in the CCM which can have problems escaping properly and can cause errors. Does the XI dashboard show the error as well or is it OK there? It's not unheard of for the button to fail but the actual check succeed and display the right information in dashboards.
What version of XI is this?
Try testing this variation(removing the double quotes) both on the command line and in the CCM:
What version of XI is this?
Try testing this variation(removing the double quotes) both on the command line and in the CCM:
Code: Select all
/usr/local/nagios/libexec/check_snmp -H x.x.x.x -o .1.3.6.1.2.1.1.5.0 -C public -s 'etm-1.tango-networks.com' -v
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
- Posts: 131
- Joined: Wed Feb 20, 2019 3:46 pm
Re: check_snmp problems
The dashboard does show the same error.
The version is 5.7.2.
Changing the quotes had no effect, same error.
The version is 5.7.2.
Changing the quotes had no effect, same error.
Re: check_snmp problems
I've been able to reproduce this somewhat. When I "tail -f /usr/local/nagiosxi/var/cmdsubsys.log" and run the check from the CCM I can see that the string it is looking for is not correct due to the extra escape characters - the issue I mentioned in my last post. The dashboard seems to work correctly though.
Try tailing this log and for the check through CCM as well as the 'Force an immediate check' link found on the service's details screen. I'd like to see the output of the tail command as well as screenshots of the service's detail screen and output as seen in the CCM.
Also check the version of the plugin with "/usr/local/nagios/libexec/check_snmp -V".
Try tailing this log and for the check through CCM as well as the 'Force an immediate check' link found on the service's details screen. I'd like to see the output of the tail command as well as screenshots of the service's detail screen and output as seen in the CCM.
Also check the version of the plugin with "/usr/local/nagios/libexec/check_snmp -V".
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Re: check_snmp problems
The plugin version matches mine. The only thing I can think of is that the current configuration is using old values for some reason. Try applying the configuration one more time in the CCM by going to Configure > Core Config Manager > Tools > Config File Management, and clicking:
Delete Files
Write Configs
Verify Files
Restart Nagios Core
and then apply the configuration again under Configure > Quick Tools > Apply Configuration.
Force another service check and if the dashboards still show an error after this, please PM me a profile and copy of the CCM database. The profile can be generated under Admin > System Config > System Profile > Download Profile, or from the command line with:
The profile is then saved to /usr/local/nagiosxi/var/components/profile.zip.
The CCM database can be gathered with:
Delete Files
Write Configs
Verify Files
Restart Nagios Core
and then apply the configuration again under Configure > Quick Tools > Apply Configuration.
Force another service check and if the dashboards still show an error after this, please PM me a profile and copy of the CCM database. The profile can be generated under Admin > System Config > System Profile > Download Profile, or from the command line with:
Code: Select all
/usr/local/nagiosxi/scripts/components/getprofile.sh 60327
The CCM database can be gathered with:
Code: Select all
mysqldump -uroot -pnagiosxi nagiosql > nagiosql.sql
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
- Posts: 131
- Joined: Wed Feb 20, 2019 3:46 pm
Re: check_snmp problems
Looks like the delete, write, verify, apply worked. It still fails in Run Check Command but it succeeds when normally polled. I hope you get the Run Check Command fixed soon. I really depend on it.
Thanks for your help on this one. Lock it.
Thanks for your help on this one. Lock it.
Re: check_snmp problems
Thanks for the update. I've added a +1 to the case we have open with dev regarding this behavior.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.