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_httpis deprecated in favor ofcheck_curlin newer Nagios Plugin releases. The configuration shown below works for both; replacecheck_httpwithcheck_curlif 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
--expectvs-e: The-eflag sets the expected string in the status line (e.g.200). Use--expect=200and treat 503 as CRITICAL using-c 503or let Nagios treat any non-200response as CRITICAL by default.- SSL verification: The
-Sflag enables HTTPS. Nagios will verify the TLS certificate forapp.alert24.net, which is a valid cert maintained by Cloudflare. check_curlequivalent: If usingcheck_curl, the flags are identical — replace the plugin name only.- Performance data:
check_httpemits response time as performance data, which Nagios can graph over time via tools like PNP4Nagios or Graphite.