process

check_process

Checks the state and metrics of one or multiple processes.

Implementation

WindowsLinuxFreeBSDMacOSX

Examples

Default Check

check_process
OK - 417 processes. |'count'=417;;;0

Check specific process(es) by name (adding some metrics as well)

check_process \
    process=httpd \
    warn='count < 1 || count > 10' \
    crit='count < 0 || count > 20' \
    top-syntax='%{status} - %{count} processes, memory %{rss|h}B, cpu %{cpu:fmt=%.1f}%, started %{oldest:age|duration} ago'
WARNING - 12 processes, memory 62.58 MB, started 01:11h ago |...

If zero is a valid threshold, set thresholds accordingly

check_process process=qemu warn='count < 0 || count > 10' crit='count < 0 || count > 20'
OK - no processes found with this filter.

In case you want to check if a given process is NOT running use something like:

check_process process=must_not_run.exe 'crit=count>0' warn=none
OK - no processes found with this filter.

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_process
    use                  generic-service
    check_command        check_nrpe!check_process!warn='count <= 0 || count > 10' crit='count <= 0 || count > 20'
}

Argument Defaults

ArgumentDefault Value
warningcount = 0
criticalstate = ‘stopped’ or count = 0
empty-state2 (CRITICAL)
empty-syntax%(status) - no processes found with this filter.
top-syntax%(status) - ${problem_list}
ok-syntax%(status) - all %{count} processes are ok.
detail-syntax${exe}=${state}

Check Specific Arguments

ArgumentDescription
processThe process to check, set to * to check all. Default: *
timezoneSets the timezone for time metrics (default is local time)

Attributes

Filter Keywords

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

AttributeDescription
processName of the executable (without path)
exeName of the executable (without path)
filenameName of the executable with path
command_lineFull command line of process
stateCurrent state (windows: started, stopped, hung - linux: idle, lock, running, sleep, stop, wait and zombie)
creationStart time of process
pidProcess id
uidUser if of process owner (linux only)
usernameUser name of process owner (linux only)
cpuCPU usage in percent
virtualVirtual memory usage in bytes
rssResident memory usage in bytes
pagefileSwap memory usage in bytes
oldestUnix timestamp of oldest process
peak_pagefilePeak swap memory usage in bytes (windows only)
handlesNumber of handles (windows only)
kernelKernel time in seconds (windows only)
peak_virtualPeak virtual size in bytes (windows only)
peak_working_setPeak working set in bytes (windows only)
userUser time in seconds (windows only)
working_setWorking set in bytes (windows only)