Page 1 of 1
Windows SNMP service - two spaces in name
Posted: Mon Jul 11, 2016 2:40 am
by jacek
Hi,
I have a quite simple problem.
One of our services on a Windows server has two space signs in it, like: "FANCY SERVICE name".
So between SERVICE and name You can notice two spacebars.
Thus the SNMP wizard sees the spaces correctly when I pick the service to be monitored it saves the name with only one.
Correcting the service name gives no effect, after saving the config there is only one space.
How can I escape this weird problem from within Nagios?
Re: Windows SNMP service - two spaces in name
Posted: Mon Jul 11, 2016 9:55 am
by rkennedy
Can you show us the full check_command that you're currently using with the service? It could just be a matter of adding quotes, or double quotes.
Re: Windows SNMP service - two spaces in name
Posted: Tue Jul 12, 2016 8:11 am
by jacek
Hi,
this one is from Nagios XI UI:
check_xi_service_snmp_win_service! -C XXXX --v2c -r -n 'YSoft PostgreSQL embedded database'
Whenever I change it to:
check_xi_service_snmp_win_service! -C XXXX --v2c -r -n 'YSoft PostgreSQL embedded database'
and save it, and then reopen the config, the double space is gone.
Re: Windows SNMP service - two spaces in name
Posted: Tue Jul 12, 2016 10:16 am
by lmiltchev
I was able to recreate the issue in Nagios XI 5.2.9, however saving a service with two spaces in the name worked just fine in our development revision. So, I won't be posting a bug report as the issue seems to be resolved.
For the time being, you could try to place the service name in the "/usr/local/nagios/etc/resource.cfg" file (use user macros) as a "workaround". For example, in the resource.cfg file, you could have:
Code: Select all
$USER9$=YSoft PostgreSQL embedded database
(double space between "PostgreSQL" and "embedded")
You service command could be:
Code: Select all
check_xi_service_snmp_win_service! -C XXXX--v2c -r -n '$USER9$
For more information on using user macros, please review our documentation on the topic here:
https://assets.nagios.com/downloads/nag ... Macros.pdf
Important: Testing the check from the CCM will probably fail, so just lick on the service under the "Service Detail" page, and schedule a forced immediate check to test it.
Let us know if this helped.
Re: Windows SNMP service - two spaces in name
Posted: Wed Jul 13, 2016 5:18 pm
by jacek
OK, this worked fine, so I should wait for the next update and this issue should be solved?
If Yes then You can close this topic, and thank You

Re: Windows SNMP service - two spaces in name
Posted: Thu Jul 14, 2016 9:31 am
by mcapra
It appears to be fixed in the latest development version. That's not a guarantee that it will be in 5.3.0 (a dev might correct me), but it's incredibly likely.
Closing this up per your request