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: 3 months ago
JSON representation
Python script with systemd units to watch for failed services
- Host: GitHub
- URL: https://github.com/ikstream/systemwatchslack
- Owner: ikstream
- License: mit
- Created: 2017-05-11T21:26:37.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-03-11T14:55:54.000Z (about 8 years ago)
- Last Synced: 2025-01-20T10:24:40.014Z (about 1 year ago)
- Topics: python3, slack, slack-webhook, systemd, systemd-service, systemd-timer
- Language: Python
- Size: 6.84 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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`