Third-Party Monitor Setup

Nagios + Alert24 Healthcheck Integration (check_http)

Use Nagios check_http or check_curl to monitor Alert24 healthcheck endpoints. Includes command definition, service definition, and plugin flags.

Nagios is the classic open-source infrastructure monitoring platform. Its check_http plugin (or the newer check_curl replacement) makes an HTTP request and evaluates the response code. Alert24 healthcheck endpoints work directly with these plugins.

Note: check_http is deprecated in favor of check_curl in newer Nagios Plugin releases. The configuration shown below works for both; replace check_http with check_curl if your installation uses the newer plugin.

Before you start

You'll need:

  • An Alert24 API key (Settings → API Keys → Create API Key)
  • The ID of the check you want to monitor, found in Monitoring → [check name] or via the API

Test the plugin manually

Before adding it to Nagios, verify the plugin works from your Nagios server:

/usr/local/nagios/libexec/check_http \
  -H app.alert24.net \
  -S \
  -u "/api/healthcheck/ak_live_YOUR_KEY/YOUR_CHECK_ID" \
  --expect=200,503

A healthy check returns HTTP OK: HTTP/1.1 200 OK. A down check returns HTTP CRITICAL: HTTP/1.1 503 Service Unavailable.

Define a command

Add this to your commands.cfg:

define command {
  command_name  check_alert24_healthcheck
  command_line  $USER1$/check_http -H app.alert24.net -S \
                  -u "/api/healthcheck/YOUR_API_KEY/$ARG1$" \
                  -e "200" -c "503"
}

Define a service

In your services.cfg, add a service for each check:

define service {
  use                   generic-service
  host_name             your-host
  service_description   Production API (via Alert24)
  check_command         check_alert24_healthcheck!YOUR_CHECK_ID
  check_interval        5
  retry_interval        1
  max_check_attempts    3
}

Org-wide service

To monitor all active Alert24 checks as a single Nagios service, use the org-wide endpoint:

define command {
  command_name  check_alert24_org
  command_line  $USER1$/check_http -H app.alert24.net -S \
                  -u "/api/healthcheck/YOUR_API_KEY" \
                  -e "200" -c "503"
}

Tips

  • --expect vs -e: The -e flag sets the expected string in the status line (e.g. 200). Use --expect=200 and treat 503 as CRITICAL using -c 503 or let Nagios treat any non-200 response as CRITICAL by default.
  • SSL verification: The -S flag enables HTTPS. Nagios will verify the TLS certificate for app.alert24.net, which is a valid cert maintained by Cloudflare.
  • check_curl equivalent: If using check_curl, the flags are identical — replace the plugin name only.
  • Performance data: check_http emits response time as performance data, which Nagios can graph over time via tools like PNP4Nagios or Graphite.