"negative" service check


i know its possible to check a windows service using nrpe/nsclient++.

But for some special usage i need to check if a service is NOT running.

My research wasn’t succesful right now…

How can i do that? Any Ideas?


if you use nrpe with the nsclient i use the following to check if a service is disabled and not running:

  vars.nrpe_command = "check_service"
  vars.nrpe_arguments = [ "service=defragsvc" , "crit= state = 'started' or start_type = 'auto'" , "warn=start_type = 'demand'" , "ok= state = 'stopped' and start_type = 'disabled'" , "top-syntax=%(status): %(list)" , "detail-syntax=%(name):%(state):%(start_type)" ]

Just modify this as you need.
In this example i check if the defrag service is disabled and not running


I’ll try it.

object Service "NRPE" {
  import "generic-service"
  host_name = "Customer - EX01"                     
  vars.nrpe_command = "check_service"
  vars.nrpe_arguments = [ "service=Acronis VSS Provider" , "crit= state = 'started'" , "warn= start_type = 'auto'" , "ok= state = 'stopped'" , "top-syntax=%(status): %(list)" , "detail-syntax=%(name):%(state):%(start_type)" ]

Am I using this wrong?
It i created it for an example host but it says me:

critical/config: Error: Validation failed for object 'Customer - EX01!NRPE' of type 'Service'; Attribute 'check_command': Attribute must not be empty.
Location: in /etc/icinga2/zones.d/Customer/Customer-EX01.conf: 26:1-26:21
/etc/icinga2/zones.d/Customer/Customer-EX01.conf(24): }
/etc/icinga2/zones.d/Customer/Customer-EX01.conf(26): object Service "NRPE" {
/etc/icinga2/zones.d/Customer/Customer-EX01.conf(27):   import "generic-service"
/etc/icinga2/zones.d/Customer/Customer-EX01.conf(28):   host_name = "Customer - EX01"

you need to define the check command in your service.

In this case you need:

check_command = "nrpe"

1 Like
Ausgabe des Plugins
Exception processing request: Request command contained illegal metachars!

Now the command reaches the nsclient++, but it gives back an error message.
I already allowed “nasty metachars” in nscp, using:

Okay it works,

i edited the nsclient.ini of another machine without purpose.:smiley:


Hi, its me again.

Do you know if it is possible to do the same thing but i want to check a .exe instead of a service?

have a look at this docs from the nsclient:

there you can check if a process is running