Giter VIP home page Giter VIP logo

aprs_station_monitor's Introduction

aprs_station_monitor

python script which send notification on telegram about the vitality of a list of APRS stations, on the basis of the last packet registered on aprs.fi database coming from the stations to be monitored.

This script periodically makes a query to aprs.fi database using APIs, and send a notification by telegram of the stations, or digipeater or igates that goes down/up. The script can be used by sysops to monitor the vitality of a group o digipeaters, and to know the vitality situation in realtime. The vitality is assumed on the basis of the last packet registered on aprs.fi database coming from the stations to be monitored. If the "last heard" interval time is more than the timeout specified in the config section, the station is declared "dead" The telegram notifications are sent every time a station changes state (Alive to Dead and Dead to Alive) This script should be executed in background (sudo python aprs_stations_monitor.py &) and is configured to log errors and transition "alive->dead" and "dead->alive"

INSTALLING AND USING

Before using this script, intall and configure the library "telegram-send ( https://pypi.org/project/telegram-send/ ) and configure the destination of the notifications (single user, group or channel).

sudo pip3 install telegram-send

telegram-send --configure if you want to send to your account telegram-send --configure-group to send to a group telegram-send --configure-channel to send to a channel.

Then, every parameter of the config section of the script must be declared, including aprs.fi API personal Key (an account on aprs.fi is required)

You can start the script automatically using systemd. Follow these instrunctions:

Create a systemd service file using: $ sudo nano /lib/systemd/system/aprs_station_monitor.service with the contents as shown below

[Unit] Description=telegram alert for aprs stations After=meadiacenter.service

[Service] User=root Group=root Type=simple ExecStart=/usr/bin/python /home/pi/Applications/aprs_station_monitor.py #change the path with yours!! Restart=Always

[Install] WantedBy=multi-user.target

Type "ctrl-o", ENTER, "ctrl-x" to save and exit the nano editor

After any changes to /lib/systemd/system/aprs_station_monitor.service: sudo systemctl daemon-reload sudo systemctl enable aprs_station_monitor.service sudo reboot

Ensure the aprs_station_monitor.service in systemd is enabled and running: systemctl list-unit-files | grep enabled systemctl | grep running | grep aprs systemctl status aprs_station_monitor.service -l

If there are any issues with starting the script using systemd, then examine the journal using: sudo journalctl -u aprs_station_monitor.service

SOFTWARE STABILITY

This script may have bugs, problems and it could be written without a lot of good programming rules. But it works for me.

Author

Alfredo IZ7BOJ iz7boj[--at--]gmail.com

LICENSE

You can modify this program, but please give a credit to original author. Program is free for non-commercial use only. (C) Alfredo IZ7BOJ 2018

Version

0.1 beta

aprs_station_monitor's People

Contributors

iz7boj 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.