service (windows)

check_service

Checks the state of one or multiple windows services.

There is a specific check_service for linux as well.

Implementation

WindowsLinuxFreeBSDMacOSX

Examples

Default Check

Checking all services except some excluded ones:

check_service exclude=edgeupdate exclude=RemoteRegistry
OK - All 15 service(s) are ok |'count'=15;;;0 'failed'=0;;;0

Checking a single service:

check_service service=dhcp
OK - All 1 service(s) are ok.

Example using NRPE and Naemon

Naemon Config

define command{
    command_name         check_nrpe
    command_line         $USER1$/check_nrpe -H $HOSTADDRESS$ -n -c $ARG1$ -a $ARG2$
}

define service {
    host_name            testhost
    service_description  check_service
    use                  generic-service
    check_command        check_nrpe!check_service!service=dhcp
}

Argument Defaults

ArgumentDefault Value
filternone
warningstate != ‘running’ && start_type = ‘delayed’
criticalstate != ‘running’ && start_type = ‘auto’
empty-state3 (UNKNOWN)
empty-syntax%(status) - No services found
top-syntax%(status) - %(crit_list), delayed (%(warn_list))
ok-syntax%(status) - All %(count) service(s) are ok.
detail-syntax${name}=${state} (${start_type})

Check Specific Arguments

ArgumentDescription
excludeList of services to exclude from the check (mainly used when service is set to *)
serviceName of the service to check (set to * to check all services). Default: *

Attributes

Filter Keywords

these can be used in filters and thresholds (along with the default attributes):

AttributeDescription
nameThe name of the service
serviceAlias for name
descDescription of the service
stateThe state of the service, one of: stopped, starting, stopping, running, continuing, pausing, paused or unknown
pidThe pid of the service
createdDate when service was started
ageSeconds since service was started
rssMemory rss in bytes
vmsMemory vms in bytes
cpuCPU usage in percent
delayedIf the service is delayed, can be 0 or 1
classificationClassification of the service, one of: kernel-driver, system-driver, service-adapter, driver, service-own-process, service-shared-process, service or interactive
start_typeThe configured start type, one of: boot, system, delayed, auto, demand, disabled or unknown