Skip to content

Python script with systemd units to watch for failed services

License

Notifications You must be signed in to change notification settings

ikstream/SystemWatchSlack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Python script with systemd units to watch for failed services

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages