Skip to content

Commit b2277e2

Browse files
committed
fix(icinga-topflap-services): ignore events with "Waiting for Icinga DB to synchronize the config." to prevent UNKNOWNs
1 parent 563aa73 commit b2277e2

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Build, CI/CD:
2828
Monitoring Plugins:
2929

3030
* by-ssh: fix traceback on "permission denied"
31+
* icinga-topflap-services: ignore events with "Waiting for Icinga DB to synchronize the config." to prevent UNKNOWNs
3132
* needs-restarting: add missung import of lib.disk
3233
* ping: '10 received' contains '0 received' ([#860](https://github.com/Linuxfabrik/monitoring-plugins/issues/860))
3334
* snmp: Special characters not supported in options --v3-auth-prot-password and --v3-priv-prot-password ([#886](https://github.com/Linuxfabrik/monitoring-plugins/issues/886))

check-plugins/icinga-topflap-services/icinga-topflap-services

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ from lib.globals import (STATE_CRIT, STATE_OK, # pylint: disable=C0413
2929
STATE_UNKNOWN, STATE_WARN)
3030

3131
__author__ = 'Linuxfabrik GmbH, Zurich/Switzerland'
32-
__version__ = '2025041701'
32+
__version__ = '2025051601'
3333

3434
DESCRIPTION = """This check plugin counts the number of state changes per service within a
3535
given lookback interval. This makes it possible to detect fast flapping services.
@@ -244,12 +244,14 @@ def main():
244244
if abs(now - data['state_event_time']) > args.LOOKBACK:
245245
continue
246246

247-
# ignore myself
248247
data['service_display_name'] = event.get('service').get('display_name')
249-
if not data['service_display_name']:
248+
# ignore events with "Waiting for Icinga DB to synchronize the config."
249+
if data['service_display_name'] is None:
250250
continue
251+
252+
# ignore myself
251253
if 'top' in data['service_display_name'].lower() and \
252-
'flap' in data['service_display_name'].lower():
254+
'flap' in data['service_display_name'].lower():
253255
continue
254256

255257
data['host_id'] = event.get('host').get('id')

0 commit comments

Comments
 (0)