Code Monkey home page Code Monkey logo

monyt's Introduction

Nat Monytor

Essentially a rewrite from the code here :

https://aws.amazon.com/articles/high-availability-for-amazon-vpc-nat-instances-an-example/

We needed big changes in order to avoid using :

  • amazon-tuned centos AMIs (and the API helpers)
  • chunks of messy shell scripts
  • centralized and maintainable configuration

Usage

The script rely on requests and boto3. Python 3.6 was used for writing and testing

pip install -r requirements.txt
python3 monyt.py config_monyt.json

The configuration is done through the json file.

How

The script ping its peer, if it detects it down it will modify the route tables

For real ?

The program automagically search for instances which 'Name' tag matches '-nat-' (tag and pattern are configurable in the config_monyt.json file)

On your nat-instances, you will want to have the program launched upon startup.

Either:

  • Write an init script relevant to the system you are running (initV, rc, systemd, ...)
  • add a line such as : screen -d -m python3 /path/to/monyt.py /path/to/config.json to /etc/rc.local (if you chose this option, the $PWD will be '/', the log will be found there by default (you can customize it in the json file))

Todo

Document the policies needed in order to avoid setting the aws-access-key being over-privileged

monyt's People

Watchers

 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.