15/05/2015

Nagios script to check cPanel license.

Hello,
As I remember, this script is one of my first scripts, it's really simple, it was some kind of 30 seconds script to solve a problem :D

It uses cPanel APIs to check cPanel license for this IP/Hostname, and If it not active, Nagios/Opsview will notify you ... that's it :-)

#!/bin/bash
#
# DESCRIPTION:
# Simple (really simple :D) Nagios script to check cPanel license.
#
# SYNTAX:
# ./check_cpanel_license.sh -H SERVER_IP/HOSTNAME (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/Hostname"
fi
Powered by Blogger.

Hello, my name is Ahmed AbouZaid and this is my "lite" technical blog!

I'm a passionate DevOps, Linux system administrator, RedHat Certified Engineer (RHCE), AWS SysOps/Solutions Architect, Free/Open source geek, author, interested in environment, calligraphy, and I believe that “Details Matter”!

Automation, data, and metrics are my preferred areas. I have a built-in monitoring chip, and too lazy to do anything manually :D

Popular Posts