Raspimon
is a simple lightweight monitoring tool for your Raspberry Pi. Virtually this can be plugged into any *nix host, but was specifically meant for hosts where a lot of overhead is not really required. It uses Telegram's web API to hook the information directly to your channel but can be extended to work with virtually any other chat/channel service. Think of it like AWS's Cloudwatch alarm configuration but much lighter and you being in total control, always.
This tool can be hooked via a cron and frequency tuned to your choice. If using your Pi with OpenMediaVault as a NAS on your mesh network, you can hook this tool via Scheduled Jobs
interface.
- Python3 on your Raspberry Pi / *nix host
- If using Telegram - BOT ID and Channel ID
- If your host doesn't already have these packages, run
pip3
with the suppliedrequirements.txt
to install all dependencies.
Download the project and extract at a location of your choice and cd
inside the project. First, tune your alerts. The alarms config is a yaml
located at configs/alarms.yaml
. For config rules see the Alert Tuning section.
By default the alarms comes with basic host metric monitoring like cpu and memory, as well as
omv-engined
process monitoring (the process being OpenMediaVault). You can add morethresholds
to the alarm to configure at different buckets levels (eg.Warning
,Critical
etc.)
We will use make
to do the initial setup. Assuming your Bot Token is MYVERYLONGBOTTOKEN
, your Channel Id is -100101010101
and you have sudo
privilege hit the following command:
raspimon $: sudo make BOT_TOKEN=MYVERYLONGBOTTOKEN CHANNEL_ID=-100101010101 install
We need
sudo
to properly set system wide environment variable. Its written to/etc/profile.d/raspimon.sh
Once done, raspimon
is ready to be triggered by your best preferred method - cron
s or UI based jobs.
Raspimon can be manually triggered:
- with Python3
$: sudo python3 raspimon.py
- with Bash
$: sudo run.sh
Or the supplied run script run.sh
can be hooked with +x
chmod
permissions to your tool or cron.
Here is a quick look at how it would look under various situations:
When a configuration error is encountered - missing ,
or illegal/missing values - a notification is sent to your channel
When a host breach happens to one or more of your defined thresholds, an Alarm notification is issued.
When a process breach happens to one or more of your defined thresholds, an Alarm notification is issued.
If you have setup your Raspberry Pi to act as VPN or as your custom NAS and you are using OpenMediaVault
you can hook this tool under the Scheduled Jobs
interface to run every 2 minutes somewhat like this:
- Alert severity
- More metric support, even though this being already highly extensible
- Slack hooks support
(c) jaiwardhan/raspimon