Recipes

Monitoring & alerting

Monitor an HTTP endpoint and alert Slack

Check an HTTP endpoint on a schedule with retries and send a Slack webhook when the check fails.

Supported platforms

LinuxmacOSWindows

Prerequisites

  • A reachable HTTP endpoint
  • A Slack incoming webhook URL exposed through an environment-backed Dagu secret

Workflow YAML

description: Check an HTTP endpoint and notify Slack when all retries fail.
schedule: "*/5 * * * *"

params:
  - name: url
    default: https://example.com/health

secrets:
  - name: SLACK_WEBHOOK_URL
    provider: env
    key: SLACK_WEBHOOK_URL

handler_on:
  failure:
    action: http.request
    with:
      method: POST
      url: ${env.SLACK_WEBHOOK_URL}
      headers:
        Content-Type: application/json
      body: '{"text":"Dagu health check failed for ${params.url}. Run: ${context.run.id}"}'
      timeout: 10

steps:
  - id: health_check
    action: http.request
    with:
      method: GET
      url: ${params.url}
      timeout: 10
      silent: true
    retry_policy:
      limit: 3
      interval_sec: 10

Review before running

Replace example values, configure the listed secrets, and review every command for your environment. Syntax validation does not make a community workflow trusted.

Running this workflow with a team?

The Team plan adds SSO, role-based access, audit logs, incident routing, and priority support for three self-hosted Dagu servers. Start a 14-day trial without a credit card.

Start Team trial
View sourceInstall DaguContributed by @dagucloud · validated with Dagu 2.13.0

Related Recipes