# Print out any Out of Memory killed process messages.
|
- command: shell.exec
|
params:
|
system_log: true
|
working_dir: src # Temporary files created in src will be cleaned up in "pre".
|
script: |
|
${set_sudo}
|
# Use dmesg -T option, if supported, to display timestamps.
|
dmesg=dmesg
|
dmesg -T > /dev/null 2>&1
|
if [ $? -eq 0 ]; then
|
dmesg="dmesg -T"
|
fi
|
$sudo $dmesg 2> /dev/null > dmesg.txt
|
if [ $? -ne 0 ]; then
|
echo "Cannot check for OOM (Out of memory) killed processes on this platform"
|
exit 0
|
fi
|
egrep -i '(Out of memory|OOM[- ]killer|Killed process)' dmesg.txt > oom.txt
|
if [ -s oom.txt ]; then
|
echo "OOM (Out of memory) killed processes detected"
|
cat oom.txt
|
else
|
echo "No OOM (Out of memory) killed processes detected"
|
fi
|