check_cpu.md 1.4 KB
Newer Older
Hahn Axel (hahn)'s avatar
Hahn Axel (hahn) committed
1
# check CPU
2

Hahn Axel (hahn)'s avatar
Hahn Axel (hahn) committed
3
## Introduction
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

**check_cpu** is a plugin to check cpu usage and cpu io wait.
It reads cpu data from output of top command and shows

   hwi - Time spent handling hardware interrupt routines. (Whenever a peripheral unit want attention form the CPU, it literally pulls a line, to signal the CPU to service it)
   swi - Time spent handling software interrupt routines. (a piece of code, calls an interrupt routine...)
    st - Time spent on involuntary waits by virtual cpu while hypervisor is servicing another processor (stolen from a virtual machine)

  nice - Time spent running niced user processes (User defined priority)
  wait - Time spent on waiting on IO peripherals (eg. disk)

system - Time spent in kernel space
  user - Time spent in user space
  idle - Time spent in idle operations

For all values it sends performance data.

Hahn Axel (hahn)'s avatar
Hahn Axel (hahn) committed
21
22
If there are processes with status D they will be shown (to analyze cpu waits).

Hahn Axel (hahn)'s avatar
Hahn Axel (hahn) committed
23
## Syntax
24
25
26

``$ check_NAME [-c CRITICAL] [-w WARING] [-i CRITICAL_IO]``

Hahn Axel (hahn)'s avatar
Hahn Axel (hahn) committed
27
### Parameters
28
29
30
31
32
33
34
35
36
37
38

```text
    -w VALUE       cpu usage warning level  (default: 75)
    -c VALUE       cpu usage critical level (default: 90)

    -i VALUE       io wait critical level   (default: 50)

    -h or --help   show this help.

```

Hahn Axel (hahn)'s avatar
Hahn Axel (hahn) committed
39
## Examples
40
41
42
43
44

``check_cpu -w 60 -c 80 -i 40``
    check cpu usage.
    It shows a warning if usage is higer 60%.
    It shows critical status if usage is higer 80% or io wait is 40%