Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Shell command alert mechanism #26

Open
rudism opened this issue Jan 25, 2023 · 0 comments
Open

Feature Request: Shell command alert mechanism #26

rudism opened this issue Jan 25, 2023 · 0 comments

Comments

@rudism
Copy link

rudism commented Jan 25, 2023

Some mechanism to fire alerts via a shell script could be used to integrate with third party services without necessarily having to support those services directly.

Some use cases I'm thinking of are making a POST using curl to a Unified Push server for mobile push notifications, or the Twilio API for SMS notifications, as a couple simple examples.

Not sure how it would work with the existing config schema... Maybe it wouldn't need explicit recipients. An idea around how to configure might look like this:

transports:
  shell:
    unified-push: curl -XPOST -d "$message" https://my-unified-push-server.com/arewedown
    sms-alert: curl -XPOST -u 'mytwiliosid:mytwiliokey' -d 'From=5557654321' -d 'To=5551234567 -d "Body=$message" https://api.twilio.com/2010-04-01/Accounts/mytwiliosid/Messages

Each alert could loop through them and populate the $message environment variable before firing the command.

This could also potentially cover #17 since I believe Telegram has an http API that could be invoked the same way (maybe using jq in the command to help construct the payload to post and piping that to curl).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant