Check_service wrong output (0.4.2)


Oke somehow I can’t get this to work (or I don’t understand how it works which is also an option.

We are using Opsview as front-end and have the opsview agent as client. I am currently testing the newer nsClient 0.4.2 because some things are easier to do more checks are built-in so less custom scripts.

I am trying to simplify our ini and making alias for checks we use a lot.

One check I am struggling with at the moment is check_service.

I have the following aliases in my ini.

win_service = check_service “filter=start_type in (‘auto’)” “top-syntax=${list}” "detail-syntax=%(name): %(state)"
win_service_name = check_service “filter=start_type in (‘delayed’,‘demand’,‘auto’)” “critical=not state_is_ok()” “service=$ARG1$” “top-syntax=${list}” “detail-syntax=%(name): %(state)”

So the first checks all services with start type "auto"
The second should check the service specified with the start type manual, delayed start or auto. It does check the service the only problem is the output is the following.

DeploymentCenter: stopped

why is it giving an OK status when the service is stopped? This is a service with start_type manual.

The same check gives the correct output for services on auto

WinRM: stopped

check_service - which services are monitored exactly? (docs are no good at it...)

state_is_ok() will allow delayed services to be stopped as they are delayed (i.e. stopped).
You can use state != ‘started’ if thats what you want. There is also a state_is_perfect() or some such which can be used but it also uses the configured status i.e. a stopped service will be “ok” if stopped.


state != started … worked for me. Heres the full command that worked to essentially get up/down status for a service with Startup Type manual, issued from command line of Nagios monitoring machine: ./check_nrpe -H -2 -c check_service -a “service=” “critical=state != started”

FYI, spaces in servicename are OK.