By Greg Nowak. Updated 25 November 2026.
A green Nagios check can sit alongside a broken customer portal. Port 443 might answer while visitors see a certificate error, land on the wrong page, or get a maintenance screen. Start with a URL customers actually use, such as the sign-in page or enquiry form, and decide what Nagios should see when it works.
For a typical public site, start with two checks. One verifies HTTPS and looks for the expected page content. The other gives the person responsible for certificate renewal time to act. Add a redirect, application health, or origin check when it answers a separate operational question.
Which HTTPS checks should you run?
| Check | What it tells you | Who investigates first |
|---|---|---|
| Public page | The public hostname serves expected content over verified HTTPS | Site on-call checks DNS, CDN and the web response |
| Certificate expiry | The certificate has reached the renewal warning window | Renewal owner checks issuance and deployment |
| Redirect | An entry URL sends visitors to the intended destination | Web or CDN owner checks routing rules |
| Application health | Essential dependencies respond as agreed | Application owner checks logs and dependency status |
| Specific origin | A selected backend answers for the production hostname | Hosting team checks that backend and its network route |
Check page content and certificate trust with check_curl
Run this from the monitoring host for a page that should respond directly. Replace the hostname, path and marker with values from your site.
check_curl -H example.com -u / --ssl -D \
--onredirect=critical -s 'Example Domain' -w 5 -c 10 -t 15-D enables certificate chain and hostname verification. --onredirect=critical treats an unexpected redirect as critical, and -s looks for a string in the response body. Choose a stable marker specific to the page, ideally something absent from your maintenance and error pages. The example warns at five seconds, goes critical at ten and sets a 15-second timeout. Tune those values to normal response times from the monitoring host and keep the timeout within Nagios Core's service check limit. Monitoring Plugins check_curl manual.
To check application health, use the same pattern with -u /health -s 'application-health:ok' if your app returns that marker. Agree with the developers which dependencies are essential and keep public diagnostic output brief. To verify that customers can actually sign in or submit a form, add a browser transaction that completes the relevant steps. GrN.dk guide to browser automation.
Give certificate expiry its own alert
check_curl -H example.com -C 30,14 -DThis warns below 30 days remaining and becomes critical below 14. Choose thresholds that leave time to fix a failed renewal or deploy the replacement, including across weekends. With -C, port 443 is the default and page checks require --continue-after-certificate. Keep -D explicit. For a private CA, supply the trusted CA bundle with --ca-cert and confirm the Nagios account can read it. Certificate options in the check_curl manual.
Check redirects and origins deliberately
When a redirect is expected, use --onredirect=curl to follow it and check the final page's content. If the destination itself matters, such as an old portal moving to a new domain, add a check that compares the redirect's Location header with the approved URL. A content match can also happen on the wrong host. Redirect options in the check_curl manual.
During a DNS cutover or CDN investigation, use -I to select an origin address and -H to retain the production hostname. Replace the example IP, check whether Nagios uses a proxy, and keep the public monitor running so you still see the customer-facing route.
check_curl -H example.com -I 203.0.113.10 -u /login --ssl -D \
--onredirect=critical -s 'Sign in' -w 5 -c 10 -t 15Move inherited check_http checks in batches
The Monitoring Plugins project deprecates its check_http and recommends check_curl. Its legacy command can still explain an inherited configuration like the one below. In that build, --sni helps the server select a certificate and the check leaves hostname and trust-chain verification unchecked. The separate Nagios Plugins project documents a --verify-host option, so identify your package and run both binaries with --version and --help before converting arguments. Monitoring Plugins check_http manual · Nagios Plugins check_http manual.
check_http -H example.com --ssl --sni -u / -s 'Example Domain' -w 5 -c 10Run the replacement as the Nagios service account, with the same proxy and CA settings it will use in service. In a test environment, try a missing marker, an unexpected redirect and an untrusted certificate. Confirm which states those failures produce, who receives each notification, and whether recovery reaches the same person. Review max_check_attempts and retry_interval so transient failures get a retry and sustained problems reach someone in time. Nagios Core state types.
To add the new check alongside the old one, use a separate command name. This example assumes $USER1$ points to the plugin directory in your resource configuration. The final line goes in an existing service definition.
define command {
command_name check_https_page_verified
command_line $USER1$/check_curl -H '$ARG1$' -u '$ARG2$' --ssl -D --onredirect=critical -s '$ARG3$' -w 5 -c 10 -t 15
}
# In the service definition
check_command check_https_page_verified!example.com!/!Example DomainVerify the configuration before reloading, then switch notifications in batches and keep the prior definitions handy for rollback. Adjust the paths below to match your installation. Nagios Core configuration verification.
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfgAt handover, record the URL, expected result, alert owner and first troubleshooting step. If the agency, host and client share responsibility, name who renews the certificate and who responds after hours. If you have inherited checks with unclear ownership or noisy alerts, I can review the current setup with you and help plan the switch. Talk to Greg about your HTTPS monitoring.
Related on GrN.dk
- Apache 2.4.68: What to Check Before You Call It Patched
- A stray Set-Cookie can waste your CDN: audit the cache at the edge
- Cloudflare Changed DoH JSON. What Else Is Parsing DNS as Text?
Need help with this kind of work?
Talk to Greg about reviewing your Nagios HTTPS checks and clarifying who responds to each alert. Get in touch with Greg.