bundlewrap/bundles/sshmon/files/check_oom_killer
Franziska Kunsmann 40a9ac4523
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good
bundles/sshmon: add check if OOM killer was active
2022-01-07 18:07:33 +01:00

14 lines
314 B
Bash

#!/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