From 1e008aef741f0f8ec95ddf47c618ab3208189c9b Mon Sep 17 00:00:00 2001 From: Yannik Schmidt Date: Thu, 6 Jan 2022 12:58:21 +0100 Subject: [PATCH] add check for 404 service not configured --- icinga-gateway-command.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/icinga-gateway-command.py b/icinga-gateway-command.py index 9c14e95..41fd40f 100755 --- a/icinga-gateway-command.py +++ b/icinga-gateway-command.py @@ -34,6 +34,10 @@ if __name__ == "__main__": response = requests.get(url) # check response status # + if response.status_code == 404: + print("The gateway does not have this service configured (404)") + sys.exit(STATUS_UNKOWN) + response.raise_for_status() # validate response content #