Current Path : /opt/zabbix_scripts/ |
|
Current File : //opt/zabbix_scripts/cpanel.WHMcpanel_Version.sh |
#!/bin/bash
################################################################################################################
# #
# !!!!!!!!!!! This file is managed by Puppet. Do not edit directly. Changes will be overwritten. !!!!!!!!!!! #
# #
# Author: William O. #
# Revision: 20191227.2100 #
################################################################################################################
STATE_OK=0
STATE_WARNING=1
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="WARNING: ${VALUE}|${CUR_VERSION}"
fi
echo "${DATA}"
exit ${RET}
Copyright 2K16 - 2K18 Indonesian Hacker Rulez