GithubHelp home page GithubHelp logo

mrwacky42 / get_ec2_events Goto Github PK

View Code? Open in Web Editor NEW

This project forked from solarce/get_ec2_events

0.0 2.0 0.0 642 KB

Helps you get a list of events with pending maintenance tasks.

Home Page: http://solarce.github.io/get_ec2_events

License: Other

Shell 100.00%

get_ec2_events's Introduction

get_ec2_events.sh

aka ballin-nemisis

Requirements

  1. You must have awscli installed, e.g. pip install awscli --upgrade
  2. You need to configure the awscli, potentially with multiple profiles

Description

Uses the awscli tool to get a list of ec2 instances from a region and return a list of systems with one of the following event types:

  • instance-reboot
  • system-reboot
  • system-maintenance
  • instance-retirement

Usage

Grab the latest release of the script and make it executable.

chmod +x get_ec2_events.sh

The script uses whatever credentials you've configured in ~/.aws/config unless you pass it a profile name.

The script now filters Events that are Completed or Canceled by default. Add --all to have it print out all instances.

Run the script like:

./get_ec2_events.sh PROFILE_NAME

[bburton@althalus] ~/code/get_ec2_events_github >> ./get_ec2_events.sh solarce_aws
Getting instances for profile solarce_aws
Region: eu-central-1
no running instances found
Region: sa-east-1
no running instances found
Region: ap-northeast-1
no running instances found
Region: eu-west-1
no running instances found
Region: us-east-1
found instances, getting status
Instance_ID:i-XXXXXXXX,Instance_Name:git.repo,Instance_Status:EVENTS::system-reboot::Scheduled::reboot::2015-03-08T04:00:00.000Z::2015-03-07T23:00:00.000Z
Instance_ID:i-XXXXXXXX,Instance_Name:keymaster,Instance_Status:EVENTS::system-reboot::Scheduled::reboot::2015-03-07T14:00:00.000Z::2015-03-07T09:00:00.000Z
Region: us-west-1
no running instances found
Region: us-west-2
no running instances found
Region: ap-southeast-2
no running instances found
Region ap-southeast-1
no running instances found

The script will also write the data to a .csv file, named like solarce_aws_us-east-1_found_instances_20150227_180338.csv

To limit the regions the script searches, set the EC2_REGIONS environment variable:

EC2_REGIONS="us-west-2 us-east-1" ./get_ec2_events.sh PROFILE_NAME

Authors

Created and maintained by Brandon Burton ([email protected]).

License

Apache 2 licensed. See LICENSE for full details.

get_ec2_events's People

Contributors

joni-lover avatar k001 avatar mrwacky42 avatar solarce avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.