License Management

Check cPanel License

Description:

Checks the status of a cPanel license

Current Version

Last Release Date

June 8, 2009

Compatible With


Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Project Files
Project Notes
Uses the cPanel website to check the status of a license for a given host or IP. The address of the license validation page can be set in the script if it were to ever change as can the regex expression used to extract the status of the license from the returned page.
Reviews (2) Add a Review
Update for current HTML Layout
by Graff, November 30, 2017
#!/usr/bin/env python
# This script is a Nagios plugin used to check the status
# of a CPanel license
#
# Author: Christopher Thunes
# Date: 15 June 2007
# License: BSD License
#
# Updater: Andrey Kishkin aka Graff
# Date: 27 November 2017

# %s should be put in place of the ip address
LICENSE_CHECK_URL = "http://verify.cpanel.net/index.cgi?ip=%s"

# Regex string to search for the 'active' keyword
#regexExtractURL = r"[^a-zA-Z0-9]*active[^a-zA-Z0-9" )
argsparser.add_option("-H", "--hostname", dest="host", help="Host to run test on" )
(options, args) = argsparser.parse_args()

# Check for the required hostname
if options.host == None:
print "-H or --hostname is required"
sys.exit(3)


numeric = None

try:
address = socket.gethostbyname(options.host)
except socket.gaierror:
printOutput( 2 )


html = urllib.urlopen( LICENSE_CHECK_URL % (address) )
regex = re.compile(regexExtractURL)

if html == None:
printOutput( 3 )

found = False;
for line in html.readlines():
if regex.search(line):
found = True

if found is False:
printOutput( 1 )

html = urllib.urlopen( LICENSE_CHECK_URL % (address) )

for line in html.readlines():
match = re.search(regexAcivatedDate ,line)
if match:
printOutput ( 0, match.group('date'))


def printOutput ( numeric, date = '' ):
returnValues = ( 0, 2, 2, 2 )

if numeric == 0:
print "CPANEL OK: license active, Activated: ", date
elif numeric == 1:
print "CPANEL CRITICAL: license inactive"
elif numeric == 2:
print "CPANEL CRITICAL: could not resolve hostname"
elif numeric == 3:
print "CPANEL CRITICAL: could not load license page"

sys.exit(returnValues[numeric])


if __name__ == "__main__":
main( )
Helpful? Yes  No 
Not Working...
by nishith, September 30, 2017
My cPanel is under 3 year license but this script is showing "License Inactive" message...!! :(

The URL mentioned inside this script seems proper as below,
http://verify.cpanel.net/index.cgi?ip=%s

Nishith N.Vyas
Helpful? Yes  No 
Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
2 (3)
Favorites
0
Views
100,254