check_cpu

Checks the CPU usage metrics.

Implementation

WindowsLinuxFreeBSDmacOS
✅✅✅✅

Argument Defaults

ArgumentDefault Value
filtercore = ’total'
warningload > 80
criticalload > 90
empty-state3 (UNKNOWN)
empty-syntaxcheck_cpu failed to find anything with this filter.
top-syntax%(status) - %(problem_list) on %(core_num) cores
ok-syntax%(status) - CPU load is ok. %(total:fmt=%d)% on %(core_num) cores
detail-syntax%(time): %(load)%

Check Specific Arguments

ArgumentDescription
n|procs-to-showNumber of processes to show when printing the top consuming processes
show-argsShow arguments when listing the top N processes
timeThe times to check, default: 5m,1m,5s

Attributes

Filter Keywords

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

AttributeDescription
coreCore to check (total or core ##)
core_idCore to check (total or core_##)
core_nrCore number of the without prefix (e.g., core_1 -> 1)
idleCurrent idle load for a given core (currently not supported)
kernelCurrent kernel load for a given core (currently not supported)
loadCurrent load for a given core
timeTime frame checked

Examples

Default Check

check_cpu
OK - CPU load is ok. |'total 5s'=13.450%;80;90 'total 1m'=13.450%;80;90 'total 5m'=13.450%;80;90

Checking each core by adding filter=none (disabling the filter):

check_cpu filter=none
OK - CPU load is ok. |'core1 5s'=9.010%;80;90 'core1 1m'=12.340%;80;90 'core1 5m'=13.450%;80;90...

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_cpu
    use                  generic-service
    check_command        check_snclient!check_cpu!'warn=load > 80' 'crit=load > 95'
}