check_service (windows)

Checks the state of one or more Windows services.

For Linux services, use check_service for Linux.

Implementation

WindowsLinuxFreeBSDmacOS
✅

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){{ IF crit_list != ’’ and warn_list != ’’ }}, {{ END }}{{ IF warn_list != ’’ }}delayed (%(warn_list)){{ END }}{{ IF crit_list == ’’ and warn_list == ’’ }}found %(count) services{{ END }}
ok-syntax%(status) - All %(count) service(s) are ok.
detail-syntax%(name)=%(state) (%(start_type))

Check Specific Arguments

ArgumentDescription
excludeServices to exclude, mainly when service is set to *. Names are case insensitive and support wildcards.
serviceServices to check (case insensitive). Set to * to check all services. Default: *

Attributes

Filter Keywords

Use these attributes in filters and thresholds, along with the default attributes:

AttributeDescription
nameService name. As a filter, searches name and display.
serviceAlias for name. As a filter, searches only name.
displayService display name. As a filter, searches name and display.
descAlias for display (not a typo). As a filter, searches only display.
descriptionDescription 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

Examples

Default Check

Check all services except those excluded:

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

Check a single service:

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

Example using check_snclient and Naemon

Naemon Config

define command{
    command_name         check_snclient
    command_line         $USER1$/check_snclient -k -p 'your-password' -u 'https://$HOSTADDRESS$:8443' $ARG1$ $ARG2$
}

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