Sentinela: Auto-shutdown cloud servers

Posted by:

During the last weeks I’ve been using some of my time to learn various aspects of cloud computing. I spend most of my time reading and testing some new ideas on Amazon’s cloud. After using Amazon’s console for a while, I started to use the Boto library for starting my instances and then pushing some code to them with Fabric.

The problem came one day when, because of a mistake on my side, a few hundred ec2 instances were left running and completely idle over the weekend. This translated into Amazon charges which I’ll sadly have to pay, and into Sentinela: an operating system watchdog that can take actions based on your specific rules.

From Sentinela’s site README.rst:

Sentinela is a highly configurable operating system watchdog which can take actions based on pre-configured rules.

The initial motivation was to create a daemon that would monitor a set of log files and if no activity was present shutdown the operating system. This was extremely useful for making sure my ec2 instances were shut down after a specified idle time.

Given Sentinela’s modular nature, you can also extend it to monitor network traffic, processes, disk usage, etc. and run any actions such as sending an email, send a SNMP alert, etc.

Sentinela has been uploaded to PyPi, so installing is as easy as running “sudo pip install sentinela”.

Remember to setup your custom rules in order to shutdown your instances and avoid those expensive charges :)


About the Author:

Web Application Security Innovator, Researcher and Entrepreneur. Python Hacker.
  Related Posts