Skip to content

Bot that scans running EC2 instances, posts their status to Slack and Google Sheets, and stops old instances to save money

License

Notifications You must be signed in to change notification settings

srosenthal/nagbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nagbot Build Status License

The Problem

Amazon Web Services provides incredible flexibility for quickly spinning up servers with a variety of configurations. The big downside is that it's easy to lose track of AWS resources and end up spending a lot more money than you expected.

At Seeq, we launch a lot of EC2 instances for a variety of development purposes (demos, testing, research & development). But we aren't always good about keeping track of them. Before Nagbot came along, cleaning up unwanted or forgotten EC2 instances was a manual process. I saw an opportunity there and volunteered to implement an automated process.

Nagbot

Nagbot is a side project I developed at Seeq and launched in May 2019. It has saved thousands of dollars every month, probably tens of thousands in the few months it has been running so far.

Nagbot does the following:

  1. Query for all of the running EC2 instances in an account, along with important metadata (Name, OS, Monthly Price, etc.)
  2. Post this information to a Slack channel and also dump the table into a Google Sheet for analysis and auditing
  3. Look at the "Stop after" tag, which is by convention a YYYY-MM-DD date, and after a warning period, stop any unwanted instances.

Here's what a Nagbot notification looks like in Slack: Example of Nagbot's Slack message

About

Bot that scans running EC2 instances, posts their status to Slack and Google Sheets, and stops old instances to save money

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages