Skip to content

Nagios Plugin check_cpu

Davide Madrisan edited this page Nov 12, 2015 · 2 revisions

check_cpu - check the CPU utilization and report the CPU characteristics

[/etc/nrpe.d/check_cpu]
command[check_cpu]=/usr/lib/nagios/plugins/check_cpu -f -w 85% -c 95%
Usage note
This plugin checks the CPU (user mode) utilization
Copyright (C) 2014-2015 Davide Madrisan <[email protected]>

Usage:
  check_cpu [-v] [-m] [-p] [-w PERC] [-c PERC] [delay [count]]
  check_cpu --cpuinfo

Options:
  -m, --no-cpu-model  do not display the CPU model in the output message
  -p, --per-cpu   display the utilization of each CPU 
  -w, --warning PERCENT   warning threshold
  -c, --critical PERCENT   critical threshold
  -v, --verbose   show details for command-line debugging 
                  (Nagios may truncate output)
  -i, --cpuinfo   show the CPU characteristics (for debugging)
  -h, --help      display this help and exit
  -V, --version   output version information and exit
  delay is the delay between updates in seconds (default: 1sec)
  count is the number of updates (default: 2)
        1 means the percentages of total CPU time from boottime.

Examples:
  check_cpu -m -p -w 85% -c 95%
  check_cpu -w 85% -c 95% 1 2
  check_cpu --cpuinfo
Example of output
cpu CPU: OK - cpu user 79.5% | cpu_user=79.5% cpu_system=20.5% cpu_idle=0.0% cpu_iowait=3% cpu_steal=0% 
Performance data

cpu_user cpu_system cpu_idle cpu_iowait cpu_steal


This plugin can also display some CPU informations (check_cpu --cpuinfo)

-= CPU Characteristics =-
Architecture:                 i686
CPU op-mode(s):               32-bit
Byte Order:                   Little Endian
CPU(s):                       2
Thread(s) per core:           2
Core(s) per socket:           1
Socket(s):                    1
Vendor ID:                    GenuineIntel
CPU Family:                   6
Model:                        28
Model name:                   Intel(R) Atom(TM) CPU N270   @ 1.60GHz
-CPU0-
CPU is Hot Pluggable:         no
Maximum Transition Latency:   10.0us
Current CPU Frequency:        1.07GHz
Available CPU Frequencies:    1.60GHz 1.33GHz 1.07GHz 800MHz
Hardware Limits:              800MHz - 1.60GHz
CPU freq Current Governor:    ondemand
CPU freq Available Governors: ondemand userspace 
CPU freq Driver:              acpi-cpufreq
-CPU1-
CPU is Hot Pluggable:         yes (online)
Maximum Transition Latency:   10.0us
Current CPU frequency:        800MHz
Available CPU Frequencies:    1.60GHz 1.33GHz 1.07GHz 800MHz
Hardware Limits:              800MHz - 1.60GHz
CPU freq Current Governor:    ondemand
CPU freq Available Governors: ondemand userspace
CPU freq Driver:              acpi-cpufreq
Documentation

Here are a few interesting internet links where you can find some stuff related to cpu and sysfs: