Windows check_service "not found" is unknown and should be critical


#1

Hi everyone!

I’ve just upgraded from a very old nsclient version and I’m deploying new configurations.

I’ve detected that if I monitor a windows service and it does not exists, the status is unknown, and it should be critical (at least for my needs, not speaking about defaults):

check_nrpe -H 192.168.100.28 -p 5666 -c check_service -a "filter=name like ‘EraAgentSvc’" OK: No services found

I’ve tried several variations but none of them tells me “critical”:

check_service -a “filter=name like ‘EraAgentSvc’” "critical=not state_is_perfect()" check_service -a “filter=name like ‘EraAgentSvc’” “empty-state=critical”

Any idea on how to be able to perform this check so I get critical when the service is stopped or it does not exists?

Thanks in advance!


#2

Have you only tried from the command line? Or from the front end?

I use the following to detect if antivirus is missing-

“filter=name in (‘tmlisten’,‘ntrtscan’)” empty-state=critical “empty-syntax=Service not detected CRITICAL”

If you don’t use the ‘empty-syntax’ it returns “OK: No services found” but does actually alert critical, this confused me for a long time as the command line doesn’t show state!