reply with correct service name

Reply with the correct service name if the service is configured but has never reported in as the icinga command expects it.
This commit is contained in:
Yannik Schmidt
2022-01-06 12:56:21 +01:00
committed by GitHub
parent fbd46c3c5f
commit f009e39280

View File

@@ -72,7 +72,8 @@ def default():
sqlalchemy.desc(Status.timestamp)).first()
if not lastSuccess and not lastFail:
return flask.jsonify(buildReponseDict(None))
# service has never reported in #
return flask.jsonify(buildReponseDict(None, service=service))
elif not lastSuccess and lastFail:
return flask.jsonify(buildReponseDict(lastFail))
else: