/usr/lib/nagios/plugins/check_shutdown is in nagios-plugins-contrib 14.20141104.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #!/bin/sh
#
# Author: Petter Reinholdtsen <pere@hungry.com>
# Date: 2011-02-03
# License: GNU GPL v2 or later
#
# Report when a reboot is in progress. Useful to detect if
# reboot-when-idle have been used on a server.
set -e
PATH=/bin:/sbin:/usr/sbin:/usr/bin
shutdownpid="`pgrep '^shutdown$'|head -1`"
if [ "$shutdownpid" ] ; then
case "`uname -s`" in
Linux)
cmd="`ps --no-headers --pid $shutdownpid -o command`"
echo "REBOOT IN PROGRESS: $cmd"
;;
*)
echo "REBOOT IN PROGRESS"
;;
esac
exit 1
fi
echo "OK - no shutdown running"
exit 0
|