Created
May 15, 2015 11:54
-
-
Save aabouzaid/137fceddbedb2f7762e1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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