bundles/sshmon: add check if OOM killer was active
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good
This commit is contained in:
parent
14e4415e5f
commit
40a9ac4523
3 changed files with 19 additions and 1 deletions
14
bundles/sshmon/files/check_oom_killer
Normal file
14
bundles/sshmon/files/check_oom_killer
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
journal="$(journalctl --since '12 hours ago' --no-hostname _TRANSPORT=kernel | grep -iF 'out of memory' -C1)"
|
||||||
|
|
||||||
|
if [[ -n "$journal" ]]
|
||||||
|
then
|
||||||
|
echo "CRITICAL - OOM killer killed processes:"
|
||||||
|
echo
|
||||||
|
echo "$journal"
|
||||||
|
exit 2
|
||||||
|
else
|
||||||
|
echo "OK - No OOM kills found in last 12 hours"
|
||||||
|
exit 0
|
||||||
|
fi
|
|
@ -55,6 +55,7 @@ for check in {
|
||||||
'http_wget',
|
'http_wget',
|
||||||
'https_certificate_at_url',
|
'https_certificate_at_url',
|
||||||
'mounts',
|
'mounts',
|
||||||
|
'oom_killer',
|
||||||
'pypi_for_new_release',
|
'pypi_for_new_release',
|
||||||
'ram',
|
'ram',
|
||||||
'systemd_unit',
|
'systemd_unit',
|
||||||
|
|
|
@ -19,7 +19,10 @@ defaults = {
|
||||||
},
|
},
|
||||||
'LOAD': {
|
'LOAD': {
|
||||||
'command_on_monitored_host': '/usr/lib/nagios/plugins/check_load -r -w 4,2,1 -c 8,4,2',
|
'command_on_monitored_host': '/usr/lib/nagios/plugins/check_load -r -w 4,2,1 -c 8,4,2',
|
||||||
}
|
},
|
||||||
|
'OOM KILLER': {
|
||||||
|
'command_on_monitored_host': 'sudo /usr/local/share/icinga/plugins/check_oom_killer',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue