Giter Site home page Giter Site logo

elonhub / bgpalerter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nlnog/bgpalerter

0.0 1.0 0.0 33 KB

BGPalerter is a script to monitor in real time if a list of <prefix, AS> pairs are announced consistently

License: BSD 3-Clause "New" or "Revised" License

Python 100.00%

bgpalerter's Introduction

BGPalerter

BGPalerter is a script to monitor in real time if a list of <prefix, AS> pairs are announced consistently.

It uses the real-time RIPE RIS streaming service to obtain BGP messages with a delay in the order of seconds.

For now BGPalerter triggers an alert if:

  1. a prefix (or a more specific) is announced by a different AS of what it should be
  2. a prefix is loosing visibility
  3. a more specific is announced instead of the prefix initially configured (but it was not supposed to happen)

Installation

Steps:

  • clone the repo: git clone [email protected]:NLNOG/bgpalerter.git or download the zip file https://github.com/NLNOG/bgpalerter/archive/master.zip

  • rename monitored_prefixes.base.yml to monitored_prefixes.yml

  • edit the monitored_prefixes.yml file to contain your prefixes.

27.114.0.0/17: <- The prefix you want to monitor
    description: A description <-- A human readable description that will appear in the notification
    base_asn: 2914 <-- The origin ASN of the prefix
    ignore_morespec: False <-- Monitor also for more specific prefix and trigger an alert if they appear (I would leave it to False!)
  • rename config.base.yml to config.yml

  • edit the config.yml file.

  • You need python 3.7, after install the other requirements with pip install -r requirements.txt

  • to run the monitoring do python runner.py

Notifications

In runner.py you can subscribe to the following event names:

  • hijack (type 1)
  • low-visibility (type 2)
  • difference (type 3)
  • heartbeat (status of the monitor)

As an example the script sends the notifications to a slack channel or to a list of email addresses (both configurable in config.yml) but you can subscribe to the event whatever callback you want.

bgpalerter's People

Contributors

massimocandela avatar

Watchers

Leon Meßner 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.