Page 1 of 1

Check_Service exclude "delayed" services in Windows

Posted: Mon May 14, 2018 2:21 pm
by gkramps
I am trying to write service to monitor Windows services using check_nrpe and check_service. I have a lot of services I've excluded, but I would like to also exclude "delayed" services that are stopped. I can't figure out the context to use and I can't find any documentation or examples.

I don't know the context on how to exclude "start_type". Below is what I have besides a laundry list of services I'm excluding. I just need to know how to exclude 'delayed'.

check_service "filter=start_type = 'auto'"

Re: Check_Service exclude "delayed" services in Windows

Posted: Tue May 15, 2018 10:12 am
by scottwilkerson
I this what you are looking for is something like this

"critical=state = not state_is_ok()"

From
https://docs.nsclient.org/reference/win ... ck_service

Code: Select all

state_is_ok() 	
Check if the state is ok, i.e. all running services are running delayed services are allowed to be stopped)

Re: Check_Service exclude "delayed" services in Windows

Posted: Fri Jun 08, 2018 2:42 pm
by gkramps
Sorry for the late reply, but that did what I needed. I also set warning=none, because it was showing up as a warning if a delayed service was stopped.

Re: Check_Service exclude "delayed" services in Windows

Posted: Fri Jun 08, 2018 4:50 pm
by lmiltchev
I am glad your issue has been resolved! I will be locking this topic. If you have any more questions/issues, please start a new thread.