Skip to content

Hooks and recipes / Recipes for tools

Recipes for tools

Copy-paste setups for Uptime Kuma, Grafana, GitHub Actions, Sentry and Apprise.

Each recipe uses a hook: create one on the recipient's page in the dashboard, copy its URL, and paste it into the tool with the ending shown below. Menus move between versions of these tools, so the steps name each field by what it does; the URL is what matters.

WarningA hook URL works without any other credential. Store it where the tool keeps secrets, and rotate the hook if the URL ends up somewhere public.

Uptime Kuma#

  1. Open Settings → Notifications and set up a new notification.
  2. Choose the Discord notification type.
  3. Paste the hook URL ending in /discord into the Discord webhook URL field.
  4. Use Test to check it, then turn the notification on for your monitors.

⫻

Discord webhook URL

https://api.meslzy.com/push/v1/hooks/hk_9Qm2Xv7Lc4Tz8Rb1Nw6Ks3Jd5Yf0Hg2P/discord

Uptime Kuma's Discord messages carry an embed with a title and fields, so the notification shows the monitor's state as the title and its details as the body. The Slack notification type works the same way with the URL ending in /slack.

Grafana alerting#

  1. Open Alerting → Contact points and add a contact point.
  2. Pick the Discord integration and paste the URL ending in /discord as its webhook URL. Or pick Slack and paste the URL ending in /slack as its webhook URL, leaving the bot token empty.
  3. Use Test to send a sample alert, save, and route alerts to the contact point in your notification policies.
https://api.meslzy.com/push/v1/hooks/hk_9Qm2Xv7Lc4Tz8Rb1Nw6Ks3Jd5Yf0Hg2P/discord

The alert's title and message become the notification's title and body. When the message carries a link to the alert, it becomes the notification's link.

GitHub Actions#

  1. Add the plain hook URL as a repository secret named PUSH_HOOK (Settings → Secrets and variables → Actions).
  2. Add this step at the end of a job. if: always() makes it run when earlier steps fail too.

⫻

workflow step

- name: Notify  if: always()  env:    PUSH_HOOK: ${{ secrets.PUSH_HOOK }}    RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}  run: |    curl --fail-with-body -sS "$PUSH_HOOK" \      -H "Title: ${{ github.workflow }}: ${{ job.status }}" \      -H "Priority: ${{ job.status == 'success' && 'default' || 'urgent' }}" \      -H "Click: $RUN_URL" \      -H "Idempotency-Key: gh-${{ github.run_id }}-${{ github.run_attempt }}" \      -d "${{ github.repository }} at ${{ github.sha }}"
  • A failed job is sent as urgent; a passing one gets the default priority, high.
  • Click opens the run, and the Idempotency-Key makes a retried step send nothing new for the same run attempt.

Sentry and Slack-compatible tools#

Any tool that asks for a Slack incoming webhook URL can send to Push: paste the hook URL ending in /slack where it wants the Slack URL. GitLab's Slack notifications integration, for example, takes such a URL.

⫻

Slack webhook URL

https://api.meslzy.com/push/v1/hooks/hk_9Qm2Xv7Lc4Tz8Rb1Nw6Ks3Jd5Yf0Hg2P/slack
NoteSentry's Slack integration installs an app into a Slack workspace instead of asking for a webhook URL, so it cannot point at a hook. To get Sentry alerts through Push, forward them from a tool that does take a Slack or Discord webhook URL, or call the plain hook from your own alert handler.

Apprise#

Apprise's jsons:// service posts its JSON notification to any HTTPS URL. Give it the hook with the /apprise ending and without the https://:

apprise -vv \  -t "Backup finished" \  -b "db-1 was copied to cold storage" \  -n success \  "jsons://api.meslzy.com/push/v1/hooks/hk_9Qm2Xv7Lc4Tz8Rb1Nw6Ks3Jd5Yf0Hg2P/apprise"
  • Apprise's notification type sets the priority: info and success are normal, warning is high and failure is urgent.
  • Tools built on Apprise take the same URL wherever they accept an Apprise URL.

Anything that can send an HTTP request#

Tools with a generic HTTP or webhook step can call the plain hook: put the title in a Title header and the text in the body. See Shell one-liners for scripts and cron jobs.

⫻

curl

curl https://api.meslzy.com/push/v1/hooks/hk_9Qm2Xv7Lc4Tz8Rb1Nw6Ks3Jd5Yf0Hg2P \  -H "Title: Front door opened" \  -H "Priority: low" \  -d "Sensor 3 at 22:41"