commit 4cafe56c97800bbcaa6ca53215d4028ad90c8354 Author: askiiart Date: Mon Jan 29 11:34:31 2024 -0600 Initial commit diff --git a/checker_template.py b/checker_template.py new file mode 100644 index 0000000..b43c5d3 --- /dev/null +++ b/checker_template.py @@ -0,0 +1,18 @@ +import random + + +class CheckerTemplate: + def __init__(arguments): + pass + + def get_status(): + latency = int(random.random() * 3000) + if latency > 2500: # "simulate" a timeout + return 0 + elif latency > 1000: # "simulate" a very slow application - a partial outage + return 50 + else: + return 100 + + def get_return_codes(): + return {0: "Down", 50: "Partial outage", 100: "Up"} diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..337d516 --- /dev/null +++ b/readme.md @@ -0,0 +1,3 @@ +# Updog checker template + +An example checker for [Updog](https://git.askiiart.net/askiiart/updog)