Setup guide
Suitaar accepts the Opsgenie Alert API. A tool that can send to Opsgenie can send to Suitaar: you change the URL and the key.
1. Make a source and a destination
- Log in with Google.
- Under Sources, add an Opsgenie source. Copy its API key: Suitaar shows it one time.
- Under Destinations, add a Slack incoming webhook or a Discord webhook. Suitaar sends a test message.
- Under Channels, connect the source to the destination.
- On the source page, click Send a test alert, and look for it in your chat.
2. Prometheus Alertmanager
Alertmanager adds v2/alerts to api_url, so api_url ends at /v1/og/.
receivers:
- name: suitaar
opsgenie_configs:
- api_key: <your Suitaar key>
api_url: http://2.31.61.58/v1/og/
send_resolved: true
With send_resolved: true, a resolved alert closes the alert in Suitaar.
3. Grafana
Make a contact point of the type Opsgenie. Set the API URL to http://2.31.61.58/v1/og/v2/alerts and the API key to your Suitaar key. Keep "Auto close" on: Grafana then closes the alert when it is resolved.
4. Scripts and other tools
Make an alert. The alias groups repeats into one alert with a count:
curl -X POST http://2.31.61.58/v1/og/v2/alerts \
-H "Authorization: GenieKey <your Suitaar key>" \
-H "Content-Type: application/json" \
-d '{"message": "Disk full on db-1", "alias": "disk-db-1", "priority": "P2"}'
Close it by its alias:
curl -X POST "http://2.31.61.58/v1/og/v2/alerts/disk-db-1/close?identifierType=alias" \
-H "Authorization: GenieKey <your Suitaar key>" \
-H "Content-Type: application/json" -d '{}'
Acknowledge and add a note in the same way with /acknowledge and /notes.
5. Heartbeats for cron jobs
On a source page, add a heartbeat with a name, an interval and a grace time. Then ping it at the end of the job:
0 2 * * * /usr/local/bin/backup.sh && curl -fsS -X POST \ -H "Authorization: GenieKey <your Suitaar key>" \ http://2.31.61.58/v1/og/v2/heartbeats/nightly-backup/ping
When no ping comes within the interval and the grace time, Suitaar opens an alert. The next ping closes it.
What is different from Opsgenie
- No on-call schedules, escalation policies, phone calls or SMS. Suitaar sends to your chat.
- Fields that Suitaar does not use (for example
responders,visibleTo,actions) are accepted and ignored, so your tools keep working. - Alerts are found by
idoralias; the short Opsgenie number (tiny) is not supported. - Acknowledge and close in Slack or Discord come later. Until then, use the API.