icinga host checkalive

This commit is contained in:
Yannik Schmidt
2021-11-25 13:07:49 +01:00
parent d848ba50fe
commit 2fef0ee7c7
2 changed files with 14 additions and 0 deletions

View File

@@ -49,3 +49,12 @@ Use the [python-script]() as a command to execute, you can pass *protocol*, *hos
assign where host.name == "your_host" 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"]
}

View File

@@ -44,6 +44,11 @@ def buildReponseDict(status, service=None):
"timestamp" : status.timestamp, "timestamp" : status.timestamp,
"info" : status.info_text } "info" : status.info_text }
@app.route('/alive')
def additionalDates():
# simple location for icinga alive checks via HTTP #
return ("", 204)
@app.route('/', methods=["GET", "POST"]) @app.route('/', methods=["GET", "POST"])
def additionalDates(): def additionalDates():
if flask.request.method == "GET": if flask.request.method == "GET":