Nagios plugin for comparing userland with kernel
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/sh | |
# | |
# Nagios check to compare host and basejail | |
# Use this freely. Enjoy. | |
# Copyright Dan Langille <dan@langille.org> | |
# | |
HOST=`/usr/bin/file -b /bin/sh` | |
JAIL=`/usr/bin/file -b /usr/jails/basejail/bin/sh` | |
if [ "${JAIL}" == "${HOST}" ] | |
then | |
echo Host and basejail are in sync | |
exit 0 | |
else | |
echo WARNING: Host and basejail are NOT in sync: host = ${HOST}, basejail = ${JAIL} | |
exit 2 | |
fi |
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/sh | |
# | |
# nagios check to compare userland and kernel on FreeBSD 9.3 and later | |
# use this freely. Enjoy. | |
# Copyright Dan Langille <dan@langille.org> | |
# | |
KERNEL=`uname -K` | |
USERLAND=`uname -U` | |
if [ "${KERNEL}" == "${USERLAND}" ] | |
then | |
echo Userland and kernel are in sync | |
exit 0 | |
else | |
echo WARNING: Userland and kernel are NOT in sync: userland = ${USERLAND}, kernel = ${KERNEL} | |
exit 2 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Great check idea. Thanks!