Page 1 of 1
Monitor Windows service which contains a comma
Posted: Mon Feb 27, 2012 5:29 pm
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!
Re: Monitor Windows service which contains a comma
Posted: Mon Feb 27, 2012 6:38 pm
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
Re: Monitor Windows service which contains a comma
Posted: Mon Feb 27, 2012 6:55 pm
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!
Re: Monitor Windows service which contains a comma
Posted: Tue Feb 28, 2012 9:34 am
by cluckinchicken
Thanks for your suggestion, but allow_nasty_meta_chars did not make any change unfortunately.
Re: Monitor Windows service which contains a comma
Posted: Tue Feb 28, 2012 6:32 pm
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

Re: Monitor Windows service which contains a comma
Posted: Thu Mar 01, 2012 10:37 am
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.
Re: Monitor Windows service which contains a comma
Posted: Fri Mar 02, 2012 12:47 pm
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!
Re: Monitor Windows service which contains a comma
Posted: Fri Mar 02, 2012 1:45 pm
by mguthrie
Ah, good question, I don't know ; )
What do you get when you run this from the command-line?