Last active
September 23, 2023 23:41
-
-
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
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
# 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='*' |
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 | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
see also https://gist.github.com/dlangille/bc9ae5b2bd37e1301cddd5d56a93da40