Authenticated API health
97-authenticated-api-health.yaml
HTTP(S)
What this example does
This example demonstrates authenticated api health.
Checks and behavior
- Sends an GET request to https://api.example.com/v1/health.
- Checks allowed/denied HTTP status codes.
- Validates required, forbidden or matching HTTP headers.
- Looks for expected response content and/or rejects known error markers.
- TLS settings cover certificate trust, certificate expiry.
- Formats results for nagios output.
Adapt example domains, addresses, credentials and thresholds to your environment before use.
YAML configuration
# Copyright (c) 2026 mati peterson. Maintainer: mati peterson <ipsonic@mailbox.org>. Project: https://ipsonic.com/probe/. Disclaimer: Provided AS IS, without warranty of any kind. Use at your own risk; validate checks and configurations before production use.
# Authenticated endpoint: token must be supplied via environment, never committed.
name: "Authenticated API health"
url: "https://api.example.com/v1/health"
request:
method: GET
headers: {Accept: application/json}
follow_redirects: false
auth:
type: bearer
token_env: IPSONIC_API_TOKEN
timeouts: {connect: 3, response: 10}
tls: {verify: true, min_valid_days: 14}
tests:
status: {allow: [200], deny: [401, 403, 500, 503]}
headers:
contains:
Content-Type: [application/json]
body:
contains: ['"healthy"']
not_contains: ["Traceback", "Internal Server Error"]
monitoring:
service_name: "Authenticated API Health"
output: nagios
on_failure: critical