Skip to content

Instantly share code, notes, and snippets.

@aabouzaid
Created May 15, 2015 11:54
Show Gist options
  • Save aabouzaid/137fceddbedb2f7762e1 to your computer and use it in GitHub Desktop.
Save aabouzaid/137fceddbedb2f7762e1 to your computer and use it in GitHub Desktop.
#!/bin/bash
#
# DESCRIPTION:
# Simple -very simple :D- Nagios script to check CPanel license.
#
# SYNTAX:
# ./check_cpanel_license.sh -H SERVER_IP (or $HOSTADDRESS$ in Nagios/Opsview)
#
# BY:
# Ahmed M. AbouZaid
#
if [ "$1" = "-H" ]; then
curl -s http://verify.cpanel.net/verifyFeed.cgi?ip=$2 | grep -q 'status="1"';
if [ $? = 0 ]; then
echo "OK - CPANEL license is active."
exit 0
else
echo "CRITICAL - CPANEL license is inactive."
exit 2
fi
else
echo "Usage: $0 [OPTION]"
echo "-H IP Address"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment