lego-monitoring/archive-arch
2025-04-27 20:39:07 +03:00
..
alerting move existing stuff to archive dir (for now) 2025-04-27 20:39:07 +03:00
assets move existing stuff to archive dir (for now) 2025-04-27 20:39:07 +03:00
misc move existing stuff to archive dir (for now) 2025-04-27 20:39:07 +03:00
tests move existing stuff to archive dir (for now) 2025-04-27 20:39:07 +03:00
wrappers move existing stuff to archive dir (for now) 2025-04-27 20:39:07 +03:00
.gitignore move existing stuff to archive dir (for now) 2025-04-27 20:39:07 +03:00
config.example.json move existing stuff to archive dir (for now) 2025-04-27 20:39:07 +03:00
LICENSE move existing stuff to archive dir (for now) 2025-04-27 20:39:07 +03:00
prettyprint.py move existing stuff to archive dir (for now) 2025-04-27 20:39:07 +03:00
README.md move existing stuff to archive dir (for now) 2025-04-27 20:39:07 +03:00
requirements.txt move existing stuff to archive dir (for now) 2025-04-27 20:39:07 +03:00
send_login_alert.py move existing stuff to archive dir (for now) 2025-04-27 20:39:07 +03:00
send_ups_alert.py move existing stuff to archive dir (for now) 2025-04-27 20:39:07 +03:00
service.py move existing stuff to archive dir (for now) 2025-04-27 20:39:07 +03:00

lego-monitoring

DISCLAIMER: This repository does not have anything to do with the LEGO Group. "lego" is the internal name of my home server.

Prerequisites

  • pacman -S libolm arch-audit
  • pip -r requirements.txt

Configuring

  • Invite the bot account to the room (you have to accept the invite manually)
  • Copy config.example.json to config.json, edit as necessary
  • Run alerting/login.py once to login into Matrix
  • (optional) Create an alerting group and give config.json's ownership and read rights to it, to allow sending alerts from less-privileged users

Setting up login alerts

  • Copy lego-login-alert to your /etc/sudoers.d
  • Add this to your /etc/ssh/sshd_config:
# login alerts
ForceCommand /opt/lego-monitoring/wrappers/login_wrapper.sh

Running

  • prettyprint.py -- check and print all sensors
  • service.py -- launch service
  • assets/lego-monitoring.service is a systemd unit that starts service.py

Disabling checks

Put names of checks into config's disabled_checks to disable them. See service.py for check names.