CHips L MINI SHELL

CHips L pro

Current Path : /opt/zabbix_scripts/
Upload File :
Current File : //opt/zabbix_scripts/check_cpanel_ips.sh

#!/bin/bash

source /usr/lib64/nagios/plugins/utils.sh

warn=${1:?Enter warn paramater}
crit=${2:?Enter critical paramater}

if [ ${warn} -le ${crit} ]
then
	echo "UNKNOWN: Warning threshold cannot be less or equal to critical threshold"
	exit $STATE_UNKNOWN
fi

ipcount=$(wc -l /etc/ipaddrpool | awk '{print $1}')
STATUS=${STATE_OK}
MSG="OK"

if [ ${ipcount} -le ${crit} ]
then
	MSG="CRITCAL"
	STATUS=$STATE_CRITICAL
elif [ ${ipcount} -le ${warn} ]
then
	MSG="WARNING"
	STATUS=$STATE_WARNING
else
	MSG="OK"
	STATUS=$STATE_OK
fi

echo "${MSG}: Dedicated IP count is ${ipcount}"
exit ${STATUS}

Copyright 2K16 - 2K18 Indonesian Hacker Rulez