snmp check tests fine but fails during normal processing

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
cdavis
Posts: 2
Joined: Fri Nov 09, 2012 11:51 am

snmp check tests fine but fails during normal processing

Post by cdavis »

Hello,

I am testing NagiosXI for a possible deployment and am having problems with an snmp check of a windows service.

I have configured a service check with the command check_xi_service_snmp_win_service with $ARG1$ of " -C mystring --v2c -n 'RedPrairie (HHWMS2)'" If I push the "Test Check Command" button and type in the same host that I have the service defined under it shows:

COMMAND: /usr/local/nagios/libexec/check_snmp_win.pl -H wms-prod2 -C mystring --v2c -n 'RedPrairie \(HHWMS2\)'
OUTPUT: 1 services active (matching "RedPrairie \(HHWMS2\)") : OK

I have also typed that command via cli and it works fine. The problem is the actual service under Service Details shows "No services matching "RedPrairie (HHWMS2)" found : CRITICAL"

I suspect that the parenthesis have something to do with this because if I escape the parenthesis it works on the cli, if I do not escape them it fails.

Code: Select all

[root@localhost var]# /usr/local/nagios/libexec/check_snmp_win.pl -H wms-prod2  -C mystring --v2c -n "RedPrairie \(HHWMS2\)"
1 services active (matching "RedPrairie \(HHWMS2\)") : OK
[root@localhost var]# /usr/local/nagios/libexec/check_snmp_win.pl -H wms-prod2  -C mystring --v2c -n "RedPrairie (HHWMS2)"                                                                                                         
No services matching "RedPrairie (HHWMS2)" found : CRITICAL
Thanks for any suggestions,
Carl
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: snmp check tests fine but fails during normal processing

Post by scottwilkerson »

In some cases the "Test command" feature will not work properly from the web interface because of having to escape items (like parentheses) but will work just fine once the item is actually added.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
cdavis
Posts: 2
Joined: Fri Nov 09, 2012 11:51 am

Re: snmp check tests fine but fails during normal processing

Post by cdavis »

Actually it is working just the opposite. The Test feature is escaping the parenthesis just fine and therefore the test shows service is OK. But the normal process of checking results in the belief that the service is down and a alert being sent.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: snmp check tests fine but fails during normal processing

Post by scottwilkerson »

The () may need to be escaped either way (you may have to add that in) as when executing from the shell, if not escaped it will try to open a subshell
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked