Commit 74dbcf74 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Merge branch '5419-update-check-packages2install' into 'master'

5419 update check packages2install

See merge request !25
parents b24b8925 0e4c3e09
......@@ -26,7 +26,8 @@ function yum.getUpdates(){
function yum.getPackageList(){
local iStart=3
# detect number of line containing "Obsoleting Packages"
typeset -i iEnd=$( echo "$packagemanOut" | grep -n '^Obsoleting Packages' | cut -f 1 -d ':' )-1
typeset -i local iEnd
iEnd=$( echo "$packagemanOut" | grep -n '^Obsoleting Packages' | cut -f 1 -d ':' )-1
local sEnd=$iEnd
test "$iEnd" = "-1" && sEnd='$'
......
# Checks
## Shared functions
There is one include script used by all checks:
[inc_pluginfunctions](inc_pluginfunctions.md)
## Check scripts
* check_apache_requests
* check_backup_one
* check_ceph_diskfree
* check_ceph_osd
* check_ceph_status
* check_clientbackup
* check_couchdb-lb
* [check_cpu](check_cpu.md)
* check_cronstatus
* check_disk-io
* check_dns_responsetime
* [check_eol](check_eol.md)
* check_haproxy_health
* check_haproxy_status
* check_memory
* check_netio
* check_netstat
* check_opencpu
* check_packages2install
* check_proc_mem
* check_proc_ressources
* check_proc_zombie
* check_reboot_required
* check_sensuplugins
* check_smartstatus
* [check_snmp_data](check_snmp_data.md)
* check_snmp_synology
* check_ssl
* check_systemdservices
* check_timesync
* check_uptime
* hello
# 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`
# check NAME
## Introduction
**check_NAME** is a plugin for ...
## Syntax
`$ check_NAME [-c CRITICAL] [-w WARING] PRODUCT VERSION`
### Parameters
...
## Examples
...
`check_NAME blubb`
Show blubber bubbles
{
"title": "IML Icinga Checks",
"author": "Axel Hahn",
"tagline": "Icinga checks written in Bash",
"ignore": {
"files": ["20_Checks/zz_template_check_.md"],
"folders": ["99_Not_Ready"]
},
"html": {
"auto_toc": true,
"auto_landing": false,
"date_modified": false,
"jump_buttons": true,
"edit_on_github_": "iml-it/__PROJECT__/tree/master/docs",
"edit_on_": {
"name": "Gitlab",
"basepath": "https://git-repo.iml.unibe.ch/iml-open-source/icinga-checks/tree/master/docs"
},
"links": {
"Git Repo": "https://git-repo.iml.unibe.ch/iml-open-source/icinga-checks"
},
"theme": "daux-blue",
"search": true
}
}
\ No newline at end of file
# IML Checks for Icinga / Nagios
## Introduction
IML - Institute for Medical Education at university in Bern, Switzerland.
This is a collection of our checks. They are used on Linux systems (Debian, CentOS, Ubuntu) and written in Bash using some shared functions.
We use Icinga graphite module to show performance data. The templates are located in a sister repository
📃 Sources:
* Checks: <https://git-repo.iml.unibe.ch/iml-open-source/icinga-checks>
* Graphs (Graphite): <https://git-repo.iml.unibe.ch/iml-open-source/icinga-graphite-templates>
📜 Licence: GNU GPL 3.0
/*
patch css elements of daux.io blue theme
version 2022-05-13
*/
/* ---------- vars ---------- */
:root{
/* background colors */
--bg:none;
--bg-body: #fff;
--bg-navlinkactive:#f4f4f4;
--bg-navlinkactive: linear-gradient(-90deg,rgba(0,0,0,0), rgba(40,60,80,0.05) 30%);
--bg-pre:#f8f8f8;
--bg-toc: #fff;
/* foreground colors */
--color: #234;
--navlinkactive:#f33;
--title: #aaa;
--link:#12a;
--toclink:rgba(40,60,80,0.8);
--h1: rgba(40,60,80,0.8);
--h1-bottom: 1px solid rgba(40,60,80,0.1);
--h2: #468;
--h3: #579;
}
/* ---------- tags ---------- */
a.Brand::before {
background: rgb(255,0,51);
color: #fff;
font-family: arial;
font-weight: bold;
padding: 0.5em 0.3em;
content: 'IML';
margin-right: 0.4em;
}
body, *{color: var(--color);}
body{background: var(--bg-body);}
a{color: var(--link);}
a:hover{opacity: 0.7;}
h1>a{ color:var(--title);}
_h1:nth-child(1){position: fixed; background: var(--bg); box-shadow: 0 0 1em #ccc; padding: 0 1em}
h1:nth-child(1)>a{ color:var(--navlinkactive); }
.s-content h1{color: var(--h1); font-size: 200%; font-weight:bold; margin-top: 2em; border-bottom: var(--h1-bottom);}
.s-content h2{color: var(--h2); font-size: 160%; }
.s-content h3{color: var(--h3); font-size: 140%; }
.s-content h4{margin: 0; font-size: 100%; text-align: center; background-color: rgba(0,0,0,0.05);padding: 0.3em;}
.s-content pre{
background: var(--bg-pre);
}
/* ---------- classes ---------- */
.required{color:#a42;}
.optional{color:#888;}
/* ----- top left */
.Brand,
.Columns__left {
background: var(--bg);
border-right: 0px solid #e7e7e9;
color: var(--color);
}
.Brand{font-size: 200%;
background_: linear-gradient(-10deg,#fff 50%, #ddd);
background: var(--bg);
}
.Columns__right__content {
background: var(--bg);
}
/* ----- Navi left */
.Nav a:hover{
background: none;
color: var(--navlinkactive) !important;
}
.Nav__item--active {
border-right_: 0.3em solid var(--navlinkactive);
}
.Nav__item--active > a{
background: var(--bg-navlinkactive);
color: var(--navlinkactive);
}
.Nav .Nav .Nav__item--active a {
color: var(--navlinkactive);
}
.Nav .Nav .Nav__item a {
opacity: 1;
}
.Nav__item--open > a {
background-color: var(--bg);
}
.Nav a[href*="__Welcome"]{
background: url("/icons/house.png") no-repeat 10px 4px ;
padding-left: 40px;
}
.Nav a[href*="__How_does_it_work"]{
background: url("/icons/light-bulb.png") no-repeat 10px 4px ;
padding-left: 40px;
}
/* ---------- classes ---------- */
/* FIX smaller fnt size in tables */
.s-content table {
font-size: 1em;
}
/* TOC */
@media(min-width:1700px){
.TableOfContentsContainer{
position: fixed;
right: 2em;
top: 1em;
}
}
.TableOfContentsContainer{
border-top-left-radius: 1em;
background-color: var(--bg-toc);
border-left: 2px solid rgba(0,0,0,0.05);
padding: 0em;
}
.TableOfContentsContainer__content {
border: none;
font-size: 0.5em;
}
ul.TableOfContents ul{
list-style-type: none;
padding-left: 1em;
}
.TableOfContentsContainer a{ color:var(--toclink);}
.TableOfContentsContainer__content > .TableOfContents > li + li {
border-top: none;
}
.TableOfContentsContainer__content > .TableOfContents > li {
border-bottom: 1px dashed #ddd;
}
/* pager - prev .. next */
.s-content{
margin-bottom: 6em;
}
.Pager{
border-top: 1px dashed #aaa; margin: 0; padding: 1em;
}
.Pager a{
color:var(--navlinkactive);
}
......@@ -2,18 +2,20 @@
## Introduction
IML - we are the Institute for Medical Education at university in Bern, Switzerland.
IML - Institute for Medical Education at university in Bern, Switzerland.
This is a collection of our checks. They are used on Linux systems (Debian, CentOS, Ubuntu) and written in Bash using some shared functions.
We use Icinga graphite module to show performance data. The templates are located in a sister repository.
We use Icinga graphite module to show performance data. The templates are located in a sister repository
## License
* Licence: GNU GPL 3.0
* Source:
* Checks: https://git-repo.iml.unibe.ch/iml-open-source/icinga-checks
* Graphs (Graphite): https://git-repo.iml.unibe.ch/iml-open-source/icinga-graphite-templates
📃 Sources:
* Checks: <https://git-repo.iml.unibe.ch/iml-open-source/icinga-checks>
* Graphs (Graphite): <https://git-repo.iml.unibe.ch/iml-open-source/icinga-graphite-templates>
📗 Docs: see [./docs/](./docs) folder \
📜 Licence: GNU GPL 3.0
## Scripts
......
# IML Checks for Icinga / Nagios
[Home](readme.md)
---
## check NAME
### Introduction
**check_NAME** is a plugin for ...
### Syntax
``$ check_NAME [-c CRITICAL] [-w WARING] PRODUCT VERSION``
#### Parameters
...
### Examples
...
``check_NAME blubb``
Show blubber bubbles
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment