Skip to content

thiswillbeyourgithub/ntfy_systemd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Systemd Outage Notifier

A simple shell script that monitors systemd units and sends notifications via ntfy when it detects failed or degraded services.

Features

  • Monitors systemd units for failed or degraded states
  • Sends detailed notifications including unit status via ntfy
  • Configurable notification endpoint
  • High priority notifications with warning tags

Prerequisites

  • zsh shell
  • systemd
  • curl
  • An ntfy server or subscription (for notifications)

Setup

  1. Clone this repository
  2. Make the script executable:
    chmod +x ntfy_sydtemd_outages.sh

Usage

Run the script manually by passing your ntfy topic as an argument:

./ntfy_sydtemd_outages.sh https://ntfy.sh/your-topic

To test without sending notifications, use 'print':

./ntfy_sydtemd_outages.sh print

For automated monitoring, set up a cron job or systemd timer.

Example crontab entry (check every 5 minutes):

*/5 * * * * /path/to/ntfy_sydtemd_outages.sh https://ntfy.sh/your-topic

Notifications

When a problematic unit is detected, you'll receive a notification with:

  • Unit name
  • Current status
  • Detailed information from systemctl
  • High priority flag
  • Warning tag for visibility

License

GPLv3

Contributing

Feel free to open issues or submit pull requests for improvements.

About

Get ntfy notifications when a systemd unit is degraded

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages