Git Product home page Git Product logo

signal-monitoring's Introduction

signal-monitoring

This program is for simple server monitoring and notifications with signal-cli. It's goal is to be able to run on supersimple servers, like NAS, raspberry pi, home routers, etc.

Setup

First, install and configure signal-cli (or replace script in notify function for different kind of notification).

Then modify script and configure your sending number, recipient number and optionally path to java. I add PATH to signal-cli and java commands as well.

Then at the bottom of the script, configure ping checks, URL string match checks and successful ssh (key) authentication.

check_ping takes one argument, which is the name of the server

check_url takes three arguments: "check identificator" (can be anything recognizable that can be a part of filename, such as hostname), URL and string to look for on the web page.

check_ssh takes three arguments: username, hostname a optional port (otherwise it's 22). Make sure that ssh key authentication is working, because it does not simply check for open port, but if the authentication succeeds. It only needs to be able to run echo command, or you can configure the shell to just print "ssh_connection_ok" on stdout. It does not need to be able to execute any other commands.

check_script takes a check identificator as the first parameter and the rest are executed (warning, no sanity checking, we expect no user input coming to this). If the script returns an error status, it failed (exit status >0)

attempts tries a check more times before notifying. Good for checks that sometimes fail, but it is not a big deal, if it works in a few seconds/minutes. attempts tries number_of_attempts times, with sleep_between_attempts seconds between intervals (these are the first two arguments) and the rest is just a normal check call.

The last signal-cli command just downloads all messages for this instance and drops them. Use this if this script is the only user using this server to ease up storage requirements for signal servers and make sure that it does not store too much (encrypted) messages for you.

Cron

Run it from cron or task scheduler of your OS. Please refer to the documentation of your OS.

Why this project

I wanted to be able to perform a simple monitoring for my hosted server from my home NAS. Signal is what I read, so e-mail notifications won't do it, I don't read e-mail that often.

The script sends one notification per hour, if the service is consistently down. When it goes up again, it sends up notification.

If you liked this script, donate

If you like this script, support me by sending a small donation

signal-monitoring's People

Contributors

jooray avatar adrianbiro 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.