bundles/sshmon: add check if OOM killer was active
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2022-01-07 18:07:33 +01:00
parent 14e4415e5f
commit 40a9ac4523
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 19 additions and 1 deletions

View 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

View file

@ -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',

View file

@ -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',
},
}, },
}, },
}, },