Initial commit
This commit is contained in:
commit
4cafe56c97
2 changed files with 21 additions and 0 deletions
18
checker_template.py
Normal file
18
checker_template.py
Normal file
|
@ -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"}
|
3
readme.md
Normal file
3
readme.md
Normal file
|
@ -0,0 +1,3 @@
|
|||
# Updog checker template
|
||||
|
||||
An example checker for [Updog](https://git.askiiart.net/askiiart/updog)
|
Loading…
Reference in a new issue