Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Nagios plugin for comparing userland with kernel
#!/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
#!/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
@dsdickinson

This comment has been minimized.

Copy link

dsdickinson commented Feb 25, 2016

Great check idea. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.