/pushover-cmd-daemon

Cron-based health check with Pushover alerts

Primary LanguageGoMIT LicenseMIT

pushover-cmd-daemon

Main status codebeat badge

Simple background app that evaluates the result of executing a command & alerts via Pushover

Setup

This project uses github.com/robfig/cron for the cron. See cron docs here: https://pkg.go.dev/github.com/robfig/cron?utm_source=godoc

  • To generate the config file just run the executable for the first time. It will generate a file config.json.
  • Run the binary in the same directory as config.json.

Config

The config.json contains the configuration for the app.

{
  "cron": "@every 1h",
  "cmd": "print",
  "args": [
    "1"
  ],
  "errorWords": [
    "error"
  ],
  "msgTitle": "Error",
  "msgBody": "Could not find 1 in result",
  "msgPriority": 0,
  "pushoverToken": "<your token here>",
  "pushoverRecipient": "<your recipient here>"
}

To do

  • Config model
  • Run CMD
  • Setup cron
  • Load result from CMD run
  • Run error function
  • If error func true, alert
  • Call Pushover notification
  • Manage releases with Github Actions
  • Release binary for Linux, MacOS and Windows
  • Better logging strategy
  • Param for config file name.
  • Param for ANSI color logs
  • Timeouts, threading.
  • Watch for hanging and notify.