Code Monkey home page Code Monkey logo

whosup's Introduction

Code purpose

The purpose of whosup.py is to provide an extremely simple app that regularly polls a set of servers, and reports when one or more goes down. I wrote this to aid in keeping track of power outages in my laboratories at Dalhousie University. We use uninterruptible power supplies, but regardless, if there's a power outage we need to know about it. A clear signal is that the (wired) internet has failed in our building. When that happens, this code gives a visual cue and also triggers a message to be sent to us on a Slack channel. That way, we get the message on our phones without having to be in direct contact with the computer running the app.

Code usage

Download

From github. There is only a single python file to download and a template of the YAML input file. Nothing to compile.

Input file

The list of servers to watch, and the Slack webhook data (private!) is read by the program from a file in YAML format. A template is included. You need to add the name by which your server is found on the internet, and also the port it uses for connections. For ssh this is typically 22, but we change the default on many of our servers to cut down on bot attacks.

Running the code

  • ./whosup.py will run the program, and assume the input YAML file is in the same directory and named whosup.yaml
  • ./whosup.py -h gives a very minimal help message.
  • ./whosup.py -f your.yaml will run the program with the YAML input file of your choosing.

whosup's People

Contributors

jzwanzig avatar

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.