diff --git a/templates/docs/signalling_failures.html b/templates/docs/signalling_failures.html
index 1855ae93..3ab67715 100644
--- a/templates/docs/signalling_failures.html
+++ b/templates/docs/signalling_failures.html
@@ -3,6 +3,20 @@
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.
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