/nani-monitoring

Small monitoring script in python for nani-games using statuspage.io automation email routes

Primary LanguagePython

Nani Monitoring

Small monitoring script in python for nani-games using statuspage.io automation email routes

Installation

git clone https://github.com/david-prv/nani-monitoring.git monitor && cd monitor
pip install -r requirements.txt
cp example.env .env
rm example.env

Open and edit .env. Update environment variables with your credentials/routes/settings:

# for Ubuntu
nano .env

Commandline Args

--repetitive or -r:
Run the script in an endless loop (daemons)

--suppress-emails or -s:
Prevent update emails to be sent (useful for development)

--turnus <seconds> or -t <seconds>:
Specifiy turnus in seconds, if repetitive mode is enabled (overrides env variable)

--help or -h (Alias: --manual or -m):
Shows script usage and quits

Run the Script

# in path/to/monitor/
python3 app.py [options]

We suggest using screen

screen -S monitor_runner python3 app.py -r

or setting up a cronjob

# for Ubuntu
sudo apt-get update && apt-get upgrade
sudo nano /etc/crontab 

# Syntax:
# * * * * * /path/to/monitor/app.py [options] 

Test the Script

We suggest using the following command to debug/test your installed version of this script:

python3 app.py -r -s -t 10 >> output
cat output

Screenshots

Help message / Manual
Coloured activity log
Suppressed activitiy log