Giter VIP home page Giter VIP logo

piping's Introduction

About PiPing

This is a Python script which pings your desired IPs and generates a plot, showing target up-time based on received replies. The plot is generated as a standard HTML file which is view-able in any standard web browser. Furthermore, if you are running this script on RaspberryPi or compatible SBC, it is possible to connect an RGB LED to RPi's GPIO to show server status. For example, LED will be turned Green if the server is up and red if un-accessible. LED colors/blinking is user configurable.

piping

Installation

  • pip3 install plotly

  • pip3 install requests

  • pip3 install subprocess

  • git clone https://github.com/mostafaasadi/piping

  • cd piping

  • nohup python3 piping.py &

  • you can also create systemd unit to manage PiPing:

  • make /etc/systemd/system/piping.service with the following contents

    for first run: sudo systemctl daemon-reload

    and manage with :

    sudo systemctl enable sudo systemctl start sudo systemctl stop

[Unit]
Description=PiPing service

[Service]
Type=simple
ExecStart=/usr/bin/python3 /home/mostafa/piping/piping.py
WorkingDirectory=/home/mostafa/piping
Restart=always
RestartSec=2

[Install]
WantedBy=sysinit.target

Configuration

To change IPs (add/remove/edit) config.py

name = servers(
'server name',
'ip',
'ping in offline/online',
'enable GPIO (on raspberrypi) check with condition True/False (recommanded: enable for IPs outside your LAN)')

and other configurations.

RaspberryPi GPIO activation

If you are running piping on RaspberryPi, enable gpiomode on config.py. Then connect RGB LED according to this diagram: piping finally set redpin,greenpin and bluepin in configuration section.

Usage

piping creates the plot as index.html and updates it according to settings and if you set http_server , True show it on your raspberrypi ip:http_port.

for example : 10.0.0.214:8008

If you are running piping on RaspberryPi or compatible SBC, it is possible to turn on gpiomode and blink an RGB LED with user configurable setting interactively. Blue color is usually used for IPs of devices in your LAN (e.g. routers). Red and Green LEDs could be turned on or blinked using multiple conditions.

Please refer to the comments in configuration section for more information.

piping's People

Contributors

mostafaasadi avatar alimirjamali 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.