Created
February 15, 2015 09:54
-
-
Save johnteslade/0357c3435d49ebf204c7 to your computer and use it in GitHub Desktop.
Nagios plugin for ubuntu machine needing reboot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Nagios plugin to check if a machine needs to be rebooted after run apt | |
# Original source http://serverfault.com/a/268528/41649 | |
if [ ! -f /var/run/reboot-required ]; then | |
# no reboot required (0=OK) | |
echo "OK: no reboot required" | |
exit 0 | |
else | |
# reboot required (1=WARN) | |
echo "WARNING: `cat /var/run/reboot-required`" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment