forked from evolix/ansible-roles
22 lines
869 B
Bash
Executable file
22 lines
869 B
Bash
Executable file
#!/bin/sh
|
|
|
|
# Script writen by Evolix
|
|
|
|
_WARNING_STATES_LIMIT=130000
|
|
_CRTICAL_STATES_LIMIT=150000
|
|
|
|
. /usr/local/libexec/nagios/utils.sh
|
|
|
|
_CHECK_STATES=$(/sbin/pfctl -si | /usr/bin/grep current | /usr/bin/sed s,\ current\ entries\ ,,g | /usr/bin/sed -e 's,^[ \t]*,,' | /usr/bin/sed 's, *$,,')
|
|
|
|
if [ $_CHECK_STATES -lt $_WARNING_STATES_LIMIT ];then
|
|
echo "OK: States number ($_CHECK_STATES) is below threshold ($_WARNING_STATES_LIMIT / $_CRTICAL_STATES_LIMIT)"
|
|
exit "$STATE_OK"
|
|
elif [ $_CHECK_STATES -ge $_WARNING_STATES_LIMIT ] && [ $_CHECK_STATES -lt $_CRTICAL_STATES_LIMIT ];then
|
|
echo "WARNING: States number is $_CHECK_STATES (threshold WARNING = $_WARNING_STATES_LIMIT)"
|
|
exit "$_STATE_WARNING"
|
|
else
|
|
echo "CRITICAL: States number is $_CHECK_STATES (threshold CRITICAL = $_CRTICAL_STATES_LIMIT)"
|
|
exit "$_STATE_CRITICAL"
|
|
fi
|