KrisChase.com

Easily monitor uptime on WHM & cPanel Server with UptimeRobot

Posted in Web Development on 06.10.2015 by @chasebadkids

It’s all about UptimeRobot

When managing multiple WHM servers with hundreds of cPanel accounts, sometimes you need a quick and easy way to monitor your sites uptime. many of you may be aware of the service Uptime Robot. If not, then you should definitely check it out. Uptime Robot is a service which allows you to freely monitor the uptime and receive alerts for up to 50 domains. You can receive slack messages, emails, pushbullet notifications and more.

API to the Rescue

Adding entries into WHM isn’t all that difficult, however when managing sites using WHM and cPanel across multiple servers, adding and removing your entries can be time consuming. Thankfully that’s where the API comes into play.

Bil Bas created an UptimeRobot client in python that allows us to easily interface with the UptimeRobot API.

Setting up the UptimeRobot Client

Install the required python packages

Debian, Ubuntu and other Debian-based distributions

Or

Download and unpack the source code.

Create a package from source and install

Modify your default config file

Using defaults
It is annoying to have to add the api key to every single uptimerobot command line. Therefore it is possible to store it into a defaults file.
Copy the file cli-master/uptimerobot/.uptimerobot.yml to your home directory and edit it accordingly. It is also possible to copy it to the current directory. uptimerobot will look in the current directory first, then in the users’s home directory. A command line setting will always override the default settings.

Now you’re all installed. Here’s the fun part

Getting your monitors created

Drop the bash script below onto your server and

Simply execute the script and all domains from your system will be added into uptime robot!

Menu