License
MIT License
The Senso Go Pushover Handler is a Sensu Event Handler for sending incident
notifications to Pushover.
This handler reuses concepts found in the sensu-email-handler.
Create an executable script from this source or download one of the existing releases.
From the local path of the sensu-go-pushover-handler repository:
go build -o /usr/local/bin/sensu-pushover-handler main.go
Example Sensu Go definition:
{
"api_version": "core/v2",
"type": "Handler",
"metadata": {
"namespace": "default",
"name": "pushover"
},
"spec": {
"type": "pipe",
"command": "sensu-pushover-handler",
"timeout": 10,
"env_vars": [
"PUSHOVER_TOKEN=a0b1c2d3e4f5g6h7i8j9k0l1m2n3o4",
"PUSHOVER_USERKEY=a0b1c2d3e4f5g6h7i8j9k0l1m"
],
"filters": [
"is_incident",
"not_silenced"
]
}
}
This handler makes use of Pushover's standard API mechanism. This means creating an application token, as well as
a user API key.
The Sensu Pushover handler for sending notifications
Usage:
sensu-pushover-handler [flags]
Flags:
-C, --criticalPriority int8 The priority for Critical status messages (default 1)
-h, --help help for sensu-pushover-handler
-b, --messageBody string The message body, in token substitution format (default "{{.Check.Output}}")
-m, --messageTitle string The message title, in token substitution format (default "{{.Entity.Name}}/{{.Check.Name}}")
-O, --okPriority int8 The priority for OK status messages (default 0)
-t, --pushoverToken string The Pushover API token, if not in env SENSU_PUSHOVER_TOKEN
-u, --pushoverUserKey string The Pushover User Key, if not in env SENSU_PUSHOVER_USERKEY
-U, --unknownPriority int8 The priority for Unknown status messages (default 1)
-W, --warningPriority int8 The priority for Warning status messages (default 0)
For defining the message title and body, tokens from the events attributes are used.
Variable | Setting | Annotation |
---|---|---|
PUSHOVER_TOKEN | same as -t / --pushoverToken | sensu.io/plugins/pushover/config/token |
PUSHOVER_USERKEY | same as -u / --pushoverUserKey | sensu.io/plugins/pushover/config/user-key |
N/A | same as -b / --messageBody | sensu.io/plugins/pushover/config/body-template |
N/A | same as -m / --messageTitle | sensu.io/plugins/pushover/config/title-template |
Note: The command line arguments take precedence over the environment variables above.
Note: Annotations take precedence over command line arguments above.
Please describe the reason for reporting this asset. Our moderators will be notified and will disable the asset if it is found to be inappropriate.
×