Skip to content
Snippets Groups Projects
Commit a4d6fce2 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

glsa-check plugin

parent 7e494a77
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
# Run glsa-check and filter out any problems. Return critical status
# if any problems exist.
#
# This check script is maintained in a Subversion repository at
# http://lsvn.lysator.liu.se/svnroot/nagios-plugins. Contact
# <ceder@lysator.liu.se> for commit access.
GLSA_TMP=`tempfile`
GREP_TMP=`tempfile`
ERR_TMP=`tempfile`
trap "rm $GLSA_TMP $GREP_TMP $ERR_TMP" 0
glsa-check -l -n > $GLSA_TMP 2> $ERR_TMP
RC=$?
if [ $RC -ne 0 ]
then
echo UNKNOWN - glsa-check returned $?
cat $ERR_TMP
exit 3
fi
grep '^[0-9][0-9]*-[0-9][0-9] \[[^AU]\]' < $GLSA_TMP > $GREP_TMP 2> $ERR_TMP
RC=$?
case $RC in
0) echo CRITICAL - glsa-check found problems:
cat $GREP_TMP
exit 2;;
1) echo OK - no GLSA-related problems found
exit 0;;
*) echo UNKNOWN - grep returned $?
cat $ERR_TMP
exit 3;;
esac
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment