Monitor Windows service which contains a comma

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
cluckinchicken
Posts: 4
Joined: Mon Feb 27, 2012 5:23 pm

Monitor Windows service which contains a comma

Post by cluckinchicken »

For some reason, I have a Windows Apache service with Service Name = apache2,2

I've enclosed in single and double quotes, I've tried to escape it, but nothing seems to work.

Does anyone know how to monitor a windows service with a comma in the name?

Thanks!
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Monitor Windows service which contains a comma

Post by jsmurphy »

Have you tried wrapping it in single quotes 'apache2,2' or tried to escape the comma? "apache2\,2" It may also fall into the nasty meta characters category so it may need to set the allow_nasty_meta_chars option: http://nsclient.org/nscp/wiki/CheckExternalScripts
cluckinchicken
Posts: 4
Joined: Mon Feb 27, 2012 5:23 pm

Re: Monitor Windows service which contains a comma

Post by cluckinchicken »

Yes, I tried with single and double quotes, and escaping as well, but no dice. I'll try the nasty meta characters tomorrow and let you know.

Thanks for the help and reply jsmurphy!
cluckinchicken
Posts: 4
Joined: Mon Feb 27, 2012 5:23 pm

Re: Monitor Windows service which contains a comma

Post by cluckinchicken »

Thanks for your suggestion, but allow_nasty_meta_chars did not make any change unfortunately.
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: Monitor Windows service which contains a comma

Post by jsmurphy »

Hmmmm I can't think of anything else off the top of my head, I remember something similar to this many months back but I can't remember what the outcome was and haven't really had to implement this myself before. I think that's about all I'm able to suggest at this point in time :(
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Monitor Windows service which contains a comma

Post by mguthrie »

The main nagios.cfg file has a list of object name characters that it won't allow:

Code: Select all

illegal_object_name_chars=`~!$%^&*|'"<>?,()=
You can try removing the comma from this list, but it can have unpredictable results.
cluckinchicken
Posts: 4
Joined: Mon Feb 27, 2012 5:23 pm

Re: Monitor Windows service which contains a comma

Post by cluckinchicken »

@mguthrie: But that shouldn't matter when I run from the command line, eh? Or would Nagios perhaps treat it differently when called? Thanks!
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Monitor Windows service which contains a comma

Post by mguthrie »

Ah, good question, I don't know ; )

What do you get when you run this from the command-line?
Locked