A Python library for sending events via kafka_consumer to OpenNMS.
Project description
onms_kafka_events
This library will allow you to generate event objects in Python to send to a Kafka topic for OpenNMS Horizon/Meridian to process.
Documentation for this project is available at https://opennms-forge.github.io/kafka-consumer-py/
Documentation for configuring the Kafka Consumer feature on your Horizon/Meridian server can be found at https://docs.opennms.com/horizon/latest/operation/deep-dive/events/sources/kafka.html.
Installation
pip install onms-kafka-events
Associating events to nodes
When received, the eventd daemon will attempt to associate the event to a node in the following order:
- If the
nodeId
field is included, the event will be matched to the node with that database ID. - If the event does not have
nodeID
, the parameters_foreignSource
and_foreignId
can be included to associate the event based on the requisition name and ID. - Any event that cannot match a node on either of these criteria will not be associated with a node.
Example
from onms_kafka_events import KafkaConnection, Severity
my_producer = KafkaConnection(
servers=["broker01:9092", "broker02:9092"], topic="opennms-kafka-events"
)
my_event = my_producer.create_event(
uei="uei.opennms.org/custom/event",
severity=Severity.WARNING,
node_id=1234,
custom="value"
)
result = my_producer.send_event(my_event)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
onms_kafka_events-1.0.0-4.tar.gz
(10.8 kB
view hashes)
Built Distribution
Close
Hashes for onms_kafka_events-1.0.0-4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 730d822baed3863cc79d9921f9ef56faf648cc4ff5eecd8f63f76573613d4d12 |
|
MD5 | c4d707679d819833cf7a8f8114eaa306 |
|
BLAKE2b-256 | 2fab73e9156bf49b72d9e88998b490941ca62e00f144cccfe1ca9b86e055285c |
Close
Hashes for onms_kafka_events-1.0.0-4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | df3225e8427244cf9ade385dc90d4a64d6181a24b6977ca22f729a50c2533074 |
|
MD5 | 866fb06773f17dfb3d752b3268273675 |
|
BLAKE2b-256 | 8eb444cae18a8949527cfe3e3258feca2ba6a3912000a0eeb5051b0413bd032b |