Skip to content

Instantly share code, notes, and snippets.

@dlangille
Last active September 23, 2023 23:41
Show Gist options
  • Save dlangille/8137ea3d4f9d47569de40eef10fe7689 to your computer and use it in GitHub Desktop.
Save dlangille/8137ea3d4f9d47569de40eef10fe7689 to your computer and use it in GitHub Desktop.
A Nagios check for FreeBSD systems which have https://www.freshports.org/ports-mgmt/pkg installed
# I use these settings in /etc/periodic.conf
# for security/405.pkg-base-audit and others
security_status_baseaudit_enable="YES"
security_status_baseaudit_jails="*"
security_status_pkgaudit_expiry=1
pkg_jails='*'
#!/bin/sh
SUDO="/usr/local/bin/sudo"
PKG_AUDIT="/usr/local/etc/periodic/security/410.pkg-audit"
RESULT=`${SUDO} ${PKG_AUDIT} 2>&1`
CODE=$?
if [ "${CODE}" == "0" ]
then
echo 'No problems found'
exit 0
else
echo ${RESULT}
exit 2
fi
@dlangille
Copy link
Author

dlangille commented Sep 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment