Skip to content
Snippets Groups Projects
Commit 0e4c3e09 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

lint md files

parent 9dd0dada
Branches
No related tags found
1 merge request!255419 update check packages2install
# IML Checks for Icinga / Nagios
# check CPU
[Home](readme.md)
---
## check CPU
### Introduction
## Introduction
**check_cpu** is a plugin to check cpu usage and cpu io wait.
It reads cpu data from output of top command and shows
......@@ -26,11 +20,11 @@ For all values it sends performance data.
If there are processes with status D they will be shown (to analyze cpu waits).
### Syntax
## Syntax
``$ check_NAME [-c CRITICAL] [-w WARING] [-i CRITICAL_IO]``
#### Parameters
### Parameters
```text
-w VALUE cpu usage warning level (default: 75)
......@@ -42,7 +36,7 @@ If there are processes with status D they will be shown (to analyze cpu waits).
```
# Examples
## Examples
``check_cpu -w 60 -c 80 -i 40``
check cpu usage.
......
# IML Checks for Icinga / Nagios
# check SNMP data
[Home](readme.md)
---
## check SNMP data
### Introduction
## Introduction
**check_snmp_data** is a plugin for fetching performance data with a set of given OIDs.
It can handle current values (i.e. load or cpu usage) and counter values (i.e. network io).
### Syntax
## Syntax
``$ check_snmp_data -h HOSTNAME [-C COOMMUNITYSTRING] -v -m METHOD``
#### Parameters
### Parameters
Starting the script without parameters shows a help.
```
```txt
SNMP performance data v1.0
......@@ -46,16 +40,16 @@ EXAMPLE:
```
### Examples
## Examples
### Get values
#### Get values
`./check_snmp_data -h 192.168.100.12 -v -m cpu`
``./check_snmp_data -h 192.168.100.12 -v -m cpu``
Shows the current cpu usage of host *192.168.100.12*.
The output is something like that:
```
```txt
OK: SNMP performance data :: CPU usage
cpu-user 0 %
cpu-system 0 %
......@@ -68,19 +62,21 @@ The 3 lines with values starting from line 2 are written with *-v* option only.
The performance data (last line) always will be sent.
#### Get counter data
### Get counter data
`./check_snmp_data -h 192.168.100.12 -v -m netio`
``./check_snmp_data -h 192.168.100.12 -v -m netio``
If there is a check with counter data using *-v* option you see the counter value and the delta speed. It is calculated by
```
```txt
[current_counter] - [last_counter]
delta_speed = ----------------------------------
time_since_last_check_in_sec
```
The output looks like that:
```
```txt
OK: SNMP performance data :: Network IO (experimental)
in total: 2669086814 delta: 1 per sec
out total: 2212665608 delta: 0 per sec
......@@ -88,19 +84,21 @@ out total: 2212665608 delta: 0 per sec
|in=1;;;0; out=0;;;0;
```
### Configuration
## Configuration
check_snmp_data is a Bash script. If you open / view it you see a DATA section as comment lines on the top.
It starts with a short description:
```
```txt
# SYNTAX:
# label --> DATA:[method]:label:[text]
# n x data --> DATA:[method]:data:[perf-label]:[oid]:[optional unit]
```
... followed by the configuration data of the checks.
```
```txt
#
# DATA:cpu:label:CPU usage
# DATA:cpu:data:cpu-user:1.3.6.1.4.1.2021.11.9.0:%
......@@ -108,7 +106,7 @@ It starts with a short description:
# DATA:cpu:data:cpu-idle:1.3.6.1.4.1.2021.11.11.0:%
```
To fetch configuration data the text in $0 is grepped by ``^#\ DATA:``.
To fetch configuration data the text in $0 is grepped by `^#\ DATA:`.
There is a single line with **label** to define a short description of the check.
......
# IML Checks for Icinga / Nagios
# Shared functions
[Home](readme.md)
## Init
---
## Shared functions
### Init
All scripts start with sourcing a shared bash file
All scripts start with sourcing a shared bash file
``. `dirname $0`/inc_pluginfunctions``
In that script are several functions starting with prefix **ph.** (=plugin helper)
### Available functions
## Available functions
This is a list in alphabetic order
......@@ -70,7 +64,7 @@ You can override it as often you want during the script. Based on the last setti
**ph.setStatusByLimit** VALUE WARNLIMIT CRITLIMIT
set statuscode by verifying integer(!) value with crtical and warning limit
set statuscode by verifying integer(!) value with crtical and warning limit
Example:
......@@ -93,23 +87,25 @@ Add performance data. Their output will be written with ph.exit. So you are free
For increasing system counters: get changerate per second since last check.
Unit value can be
* s or sec - for seconds
* m or min - for minutes
Example:
# speed in byte per sec based on last stored value and its age
iSpeedRead=` ph.perfdeltaspeed "netio-${myinterface}-rx" $iRead`
```txt
# speed in byte per sec based on last stored value and its age
iSpeedRead=` ph.perfdeltaspeed "netio-${myinterface}-rx" $iRead`
```
**ph.perfshow**
dump performance data (if u are not using ph.exit)
**ph.require** [PROG [PROG2]]
**ph.require** [PROG [...PROG_N]]
check if a binary PROG exists in search path (=are installed) - if not then execution stops with showing a warning message and status unknown (using ph.abort).
Example:
``ph.require bc lsblk``
`ph.require bc lsblk`
# IML Checks for Icinga / Nagios
# check NAME
[Home](readme.md)
---
## check NAME
### Introduction
## Introduction
**check_NAME** is a plugin for ...
### Syntax
## Syntax
``$ check_NAME [-c CRITICAL] [-w WARING] PRODUCT VERSION``
`$ check_NAME [-c CRITICAL] [-w WARING] PRODUCT VERSION`
#### Parameters
### Parameters
...
### Examples
## Examples
...
``check_NAME blubb``
`check_NAME blubb`
Show blubber bubbles
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment