OpsView tip (Windows service names with spaces).
For those that don’t know what it is. OpsView is a free front-end for the popular network monitoring system known as Nagios. Thanks to OpsView (http://www.opsview.org), people like me can setup no hassle network monitoring of several critical systems and services managed on a day to day basis. I plan to be releasing an opsview virtual appliance on my website soon, but in the meantime, I’m writing my findings here.
In all my searching, I haven’t found instructions or an example of how to monitor a windows service with spaces in the name through OpsView anywhere. I’ve come close, but the example I found reports a green status whether the service is up or not. I can’t remember where I found that, but if you’ve searched like me, you’ve probably found it too. Anyway, below is a standard format in opsview for a standard windows service (I’ll use a Citrix PS service as an example here):
check_nrpe -H $HOSTADDRESS$ -c nsc_checkservicestate -a ‘ShowAll IMAAdvanceSrv=started’
However, what if I wanted to monitor the Citrix SMA service? The service name has spaces in it. No problem! Here you go:
check_nrpe -H $HOSTADDRESS$ -c nsc_checkservicestate -a ‘ShowAll “Citrix SMA Service’=started\\”
Yes it’s odd.. note the single and double quotes are intentionally inconsistent. The combination of double escape sequences and odd single/double quoting is what does it though. If you want OpsView to monitor a service with spaces in it, you need to replace “Citrix SMA Service” in the line above with whatever service you intend to monitor. This has been tested with OpsView 3.5.2. and I use it regularly to monitor dozens of services across dozens of servers.
As of 10/14/2010 – I realized there’s a major issue with the syntax if you’re reading this from my forum and not my blog post. If you’re reading this from the forum, you’re missing some backslash characters and it’ll never work for you. Please use the link at the bottom of the post to read the original blog to see the proper syntax. Thanks.