Skip to content

Instantly share code, notes, and snippets.

@jirutka
Last active March 2, 2016 18:20
Show Gist options
  • Save jirutka/24462017611fdda67398 to your computer and use it in GitHub Desktop.
Save jirutka/24462017611fdda67398 to your computer and use it in GitHub Desktop.
Very simple NRPE (nagios) module to check crashed services via OpenRC.
#!/bin/sh
# vim: set ts=4:
crashed=$(sudo rc-status --crashed)
if [ -n "$crashed" ]; then
echo "CRITICAL - crashed services: ${crashed//$'\n'/, }"
exit 2
else
echo 'OK'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment