bundles/sshmon: add check if OOM killer was active
kunsi/bundlewrap/pipeline/head This commit looks good Details

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',
'https_certificate_at_url',
'mounts',
'oom_killer',
'pypi_for_new_release',
'ram',
'systemd_unit',

View File

@ -19,7 +19,10 @@ defaults = {
},
'LOAD': {
'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',
},
},
},
},