Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ikstream/systemwatchslack

Python script with systemd units to watch for failed services
https://github.com/ikstream/systemwatchslack

python3 slack slack-webhook systemd systemd-service systemd-timer

Last synced: 6 days ago
JSON representation

Python script with systemd units to watch for failed services

Awesome Lists containing this project

README

        

# SystemWatchSlack
Python script with systemd units to watch for failed services

This script will use `systemd --failed` to retrieve failed services
and post them to the slack team and channel you specify

## Usage
To use SystemWatchSlack you first have to set your team and channel in `systemd-watcher.py`

Afterward copy the systemd timer and service file to your systemd directory

`# cp watch-systemd.* /etc/systemd/system/`

Now enable and start the timer

`# systemctl enable watch-systemd.timer`

`# systemctl start watch-systemd.timer`

By default the timer will start the script every 10 minutes and 30 seconds after reboot. You can change this in watch-systemd.timer.

Change start time after reboot to 20 seconds

`OnBootSec=20sec`

Change intervall to every week

`OnUnitActiveSec=1w`