Commit 51a09c36 authored by Navid Sassan's avatar Navid Sassan

logfile: improved error handling

parent bb009d98
......@@ -34,7 +34,7 @@ import lib.icinga2
from lib.globals2 import STATE_OK, STATE_WARN, STATE_CRIT, STATE_UNKNOWN
__author__ = 'Linuxfabrik GmbH, Zurich/Switzerland'
__version__ = '2021022501'
__version__ = '2021022601'
DESCRIPTION = "Scans a logfile for set of pattern or regex and alarms on the number of findings."
......@@ -357,6 +357,8 @@ def main():
msg_addendum += 'Note: Acknowledge this service to reset the state to OK.'
except IndexError:
msg_addendum += 'Note: Could not determine the acknowledgement from the Icinga API, this could be due to a wrong service name.'
else:
msg_addendum += f'Note: Could not determine the acknowledgement from the Icinga API:\n{icinga}.'
# save to db, these lines will be alarmed until the service is acknowledged in icinga2
for match in warn_matches:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment