omdnotificationforwarder 2.7__tar.gz → 2.7.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/PKG-INFO +1 -1
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/bin/notificationforwarder +1 -1
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/pyproject.toml +1 -1
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/src/notificationforwarder/baseclass.py +17 -1
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/src/notificationforwarder/example/forwarder.py +3 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/.gitignore +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/README.md +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/src/notificationforwarder/email/formatter.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/src/notificationforwarder/email/forwarder.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/src/notificationforwarder/example/formatter.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/src/notificationforwarder/naemonlog/reporter.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/src/notificationforwarder/rabbitmq/formatter.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/src/notificationforwarder/rabbitmq/forwarder.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/src/notificationforwarder/syslog/formatter.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/src/notificationforwarder/syslog/forwarder.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/src/notificationforwarder/telegram/forwarder.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/src/notificationforwarder/webhook/forwarder.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/pythonpath/lib/python/notificationforwarder/split1/forwarder.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/pythonpath/lib/python/notificationforwarder/split2/formatter.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/pythonpath/lib/python/notificationforwarder/split2/forwarder.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/pythonpath/lib/python/notificationforwarder/split3/formatter.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/pythonpath/lib/python/notificationforwarder/split3/forwarder.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/pythonpath/local/lib/python/notificationforwarder/alertmanager_servicenow/formatter.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/pythonpath/local/lib/python/notificationforwarder/bayern/formatter.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/pythonpath/local/lib/python/notificationforwarder/discard/formatter.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/pythonpath/local/lib/python/notificationforwarder/split1/formatter.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/pythonpath/local/lib/python/notificationforwarder/split2/forwarder.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/pythonpath/local/lib/python/notificationforwarder/split3/formatter.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/pythonpath/local/lib/python/notificationforwarder/split3/forwarder.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/pythonpath/local/lib/python/notificationforwarder/split4/formatter.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/pythonpath/local/lib/python/notificationforwarder/split4/forwarder.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/pythonpath/local/lib/python/notificationforwarder/vong/formatter.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/test_alertmanager.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/test_classes.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/test_discard.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/test_formatter.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/test_package.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/test_paths.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/test_reporter.py +0 -0
- {omdnotificationforwarder-2.7 → omdnotificationforwarder-2.7.1}/tests/test_webhook.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: omdnotificationforwarder
|
|
3
|
-
Version: 2.7
|
|
3
|
+
Version: 2.7.1
|
|
4
4
|
Summary: A framework for notification scripts for OMD
|
|
5
5
|
Project-URL: Homepage, https://github.com/lausser/noteventificationforhandlerwarder
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/lausser/noteventificationforhandlerwarder/issues
|
|
@@ -74,7 +74,7 @@ Example for an HTTP-based reporter:
|
|
|
74
74
|
help='Increase the log level to DEBUG',
|
|
75
75
|
default=False)
|
|
76
76
|
parser.add_argument('--version', action='version',
|
|
77
|
-
version=f'%(prog)s 2.7')
|
|
77
|
+
version=f'%(prog)s 2.7.1')
|
|
78
78
|
|
|
79
79
|
args = parser.parse_args()
|
|
80
80
|
if not hasattr(args, 'formatter'):
|
|
@@ -280,6 +280,18 @@ class NotificationForwarder(object):
|
|
|
280
280
|
formatted_event.eventopts["formatter_summary"] = formatted_event.summary
|
|
281
281
|
self.report_event(formatted_event)
|
|
282
282
|
|
|
283
|
+
def forward_multiple(self, raw_event):
|
|
284
|
+
# this method requires a formatter which implements a method split_events!
|
|
285
|
+
instance = self.new_formatter()
|
|
286
|
+
try:
|
|
287
|
+
raw_event_list = instance.split_events(raw_event)
|
|
288
|
+
instance = None
|
|
289
|
+
logger.debug(f"received a payload with {len(raw_event_list)} single events")
|
|
290
|
+
for raw_event in raw_event_list:
|
|
291
|
+
self.forward(raw_event)
|
|
292
|
+
except Exception as e:
|
|
293
|
+
logger.critical(f"error split_events failed for {raw_event}")
|
|
294
|
+
|
|
283
295
|
def enrich_raw_event(self, raw_event):
|
|
284
296
|
if not "omd_site" in raw_event:
|
|
285
297
|
raw_event["omd_site"] = os.environ.get("OMD_SITE", "get https://omd.consol.de/docs/omd")
|
|
@@ -372,7 +384,7 @@ class NotificationForwarder(object):
|
|
|
372
384
|
sql_select = "SELECT id, payload FROM "+self.table_name+" ORDER BY id LIMIT 10"
|
|
373
385
|
sql_delete_id = "DELETE FROM "+self.table_name+" WHERE id = ?"
|
|
374
386
|
with open(self.db_lock_file, "w") as lock_file:
|
|
375
|
-
locked = acquire_lock_with_retry(lock_file)
|
|
387
|
+
locked = self.acquire_lock_with_retry(lock_file)
|
|
376
388
|
if locked:
|
|
377
389
|
try:
|
|
378
390
|
outdated = int(time.time() - 60*self.max_spool_minutes)
|
|
@@ -449,6 +461,10 @@ class NotificationFormatter(metaclass=ABCMeta):
|
|
|
449
461
|
def format_event(self):
|
|
450
462
|
pass
|
|
451
463
|
|
|
464
|
+
@abstractmethod
|
|
465
|
+
def split_events(self):
|
|
466
|
+
pass
|
|
467
|
+
|
|
452
468
|
|
|
453
469
|
class FormattedEvent(metaclass=ABCMeta):
|
|
454
470
|
def __init__(self, eventopts):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|