diff --git a/README.md b/README.md index 0c1769f..65e103e 100644 --- a/README.md +++ b/README.md @@ -49,3 +49,12 @@ Use the [python-script]() as a command to execute, you can pass *protocol*, *hos assign where host.name == "your_host" } +Icinga won't have a direct line to an actual host. You can define the remote hosts normally but change the alive check from *hostalive* to *http* and check the gateway availability instead. This will also prevent an error flood if the gateway ever becomes unreachable. The gateway has the */alive* for this purpose. + + object Host "laptop_1"{ + display_name = "Sheppy's Laptop" + address = "localhost" + check_command = "http" + groups = ["gateway-host", "linux-generic"] + } + diff --git a/server.py b/server.py index 6ecd030..5c959ca 100755 --- a/server.py +++ b/server.py @@ -44,6 +44,11 @@ def buildReponseDict(status, service=None): "timestamp" : status.timestamp, "info" : status.info_text } +@app.route('/alive') +def additionalDates(): + # simple location for icinga alive checks via HTTP # + return ("", 204) + @app.route('/', methods=["GET", "POST"]) def additionalDates(): if flask.request.method == "GET":