From 564f69aca5b31073fd1fb004592426ca18d9c17f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C4=93teris=20Caune?= /fail
URL will immediately mark the check as "down".
You can use this feature to minimize the delay from your monitored service failing
to you getting a notification.
The below shell script sends sends either a "success" or "failure" ping depending on +command's (certbot in this example) exit code:
+#!/bin/sh
+
+url=PING_URL
+
+/usr/bin/certbot renew
+
+if [ $? -ne 0 ]; then url=$url/fail; fi
+curl --retry 3 $url
+
Below is a skeleton code example in Python which signals a failure when the work function returns an unexpected value or throws an exception:
diff --git a/templates/docs/signalling_failures.md b/templates/docs/signalling_failures.md index 45e2b0dd..b4bda2bc 100644 --- a/templates/docs/signalling_failures.md +++ b/templates/docs/signalling_failures.md @@ -5,6 +5,22 @@ Requesting the `/fail` URL will immediately mark the check as "down". You can use this feature to minimize the delay from your monitored service failing to you getting a notification. +## Shell Scripts + +The below shell script sends sends either a "success" or "failure" ping depending on +command's (certbot in this example) exit code: + +```bash +#!/bin/sh + +url=PING_URL + +/usr/bin/certbot renew + +if [ $? -ne 0 ]; then url=$url/fail; fi +curl --retry 3 $url +``` + ## Python Below is a skeleton code example in Python which signals a failure when the