Windows SNMP service - two spaces in name

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jacek
Posts: 255
Joined: Wed Sep 09, 2015 5:49 am

Windows SNMP service - two spaces in name

Post 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?
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: Windows SNMP service - two spaces in name

Post 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.
Former Nagios Employee
jacek
Posts: 255
Joined: Wed Sep 09, 2015 5:49 am

Re: Windows SNMP service - two spaces in name

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Windows SNMP service - two spaces in name

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jacek
Posts: 255
Joined: Wed Sep 09, 2015 5:49 am

Re: Windows SNMP service - two spaces in name

Post 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 :-)
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: Windows SNMP service - two spaces in name

Post 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
Former Nagios employee
https://www.mcapra.com/
Locked