login alerts

This commit is contained in:
Alex 2025-01-07 02:52:19 +03:00
parent 3eb358d618
commit 0e177210f6
10 changed files with 85 additions and 5 deletions

View file

@ -13,8 +13,17 @@ DISCLAIMER: This repository does not have anything to do with the LEGO Group. "l
* Copy `config.example.json` to `config.json`, edit as necessary
* Run `alerting/login.py` once to login into Matrix
### 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
* `lego-monitoring.service` is a systemd unit that starts `service.py`
* `assets/lego-monitoring.service` is a systemd unit that starts `service.py`