Skip to content

Instantly share code, notes, and snippets.

@aabouzaid
Created May 15, 2015 11:54

Revisions

  1. aabouzaid created this gist May 15, 2015.
    25 changes: 25 additions & 0 deletions check_cpanel_license.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,25 @@
    #!/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