Windows service names in Nagios 3


#1

I’m totally new to Nagios. I installed Nagios 3 on a Ubuntu machine and it seems to work fine except when I deal with Windows services - the ones I’ve tried so far report something like this:

***** Nagios *****

Notification Type: PROBLEM

Service: IIS Admin
Host: winxp197 (My PC)
Address: 172.16.10.15
State: WARNING

Date/Time: Fri Feb 8 16:01:53 PST 2008

Additional Info:

IIS Admin: Unknown

Is it telling me that it doesn’t know about the IIS Admin service? Are spaces a problem when specifying the service name?

The cfg file has this in it:

define service {
use generic-service
host_name winxp197
servicce_description IIS Admin
check_command check_nt!SERVICESTATE! -d SHOWALL -l IIS Admin

I also tried the service with double quotes around it. I get the State: WARNING no matter whether IIS Admin is started or stopped.

Tom


#2

Hi!

I don’t really know what’s the problem, but after trying the check_nt command, I found out the correct syntax was:
check_nt -H sw0129 -v SERVICESTATE -l “IIS Admin” -d “SHOWALL”

Also, when you want to do a check, you should separate all your arguments. So, instead of writing “-d SHOWALL -l IIS Admin”, you should write “!-d!SHOWALL!-l!IIS Admin”

hence, your check_command should maybe be:
check_command check_nt!-v!SERVICESTATE!-d!SHOWALL!-l!IIS Admin!

with your command check_nt is defined as:
define command{
command_name check_nt
command_line $USER1$/check_nt “$ARG1$” “$ARG2$” “$ARG3$” “$ARG4$” “$ARG5$” “$ARG6$”
}

I hope this will help you :slight_smile:


#3

not sure if this actually works or not (lol) but i used :-

define service{
use generic-service
host_name 3mplanet-web01
service_description IIS
check_command check_nt!SERVICESTATE -d SHOWALL -l IISAdmin
}

I get an “OK” in my nagioadmin window so guessing it’s working hehe

only one way to find out (stopping IIS!) which i can’t really do at the moment :frowning:


#4

Well, I see not “it worked” or “im still stuck” reply so I thought i would add that “W3SVC” is the WWW Publishing Service’s name

check_nt!SERVICESTATE!-l W3SVC-d SHOWALL
should work I believe

by the way, if you are wanting to monitor a service with a space in it’s name, use
check_nt!SERVICESTATE!-l “The Service Name” -d SHOWALL


#5

for other that want to find out other Window services like me but are having trouble you can find it under the registery

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services

as i have foud this website very helpful so just want to give something back cheers


#6

You can also open the services.msc and go to the desired service that you want to monitor. Right-click and open properties. The first thing that you see on the top is the exact service name. I prefer this instead of opening the registry.


#7

Yes I know that’s the quicker way but when you get to a service like Network location awareness the process is ‘C:\WINDOWS\system32\svchost.exe -k netsvcs’ how would you add that in nagios? you can’t so you have to do it through the registery