Voltha Alarm Management using OpenNMS and Elasticsearch
- Added necessary configuration to run a self-contained instance of
OpenNMS
- Elasticsearch/Logstash is responsible for the interception of voltha
alarms and to forward to OpenNMS
Amendment:
- Cleaned up untouched opennms config files
- Added Dockerfile and scripts to override the default entrypoint script
Change-Id: Id611a330f7274d016281e734ade79d22bfc0356b
diff --git a/compose/docker-compose-elasticsearch.yml b/compose/docker-compose-elasticsearch.yml
new file mode 100644
index 0000000..3bc75fe
--- /dev/null
+++ b/compose/docker-compose-elasticsearch.yml
@@ -0,0 +1,32 @@
+version: '2'
+
+services:
+ elasticsearch:
+ image: docker.elastic.co/elasticsearch/elasticsearch:5.2.2
+ environment:
+ - transport.host=localhost
+ - transport.tcp.port=9300
+ - xpack.security.enabled=false
+ ports:
+ - "9200:9200"
+ - "9300:9300"
+ networks:
+ - docker_elastic
+
+ logstash:
+ build: ./elasticsearch/logstash
+ environment:
+ - log.level=info
+ command: logstash -f /etc/logstash/conf.d/
+ volumes:
+ - ./elasticsearch/logstash/config:/etc/logstash/conf.d
+ ports:
+ - "5000:5000"
+ networks:
+ - docker_elastic
+ depends_on:
+ - elasticsearch
+
+networks:
+ docker_elastic:
+ driver: bridge
diff --git a/compose/docker-compose-opennms.yml b/compose/docker-compose-opennms.yml
new file mode 100644
index 0000000..a1d8968
--- /dev/null
+++ b/compose/docker-compose-opennms.yml
@@ -0,0 +1,45 @@
+version: '2'
+services:
+ database_data:
+ image: tianon/true
+ volumes:
+ - /var/lib/postgresql/data
+
+ database:
+ image: postgres:9.6.1
+ env_file:
+ - ./opennms/env/postgres.env
+ ports:
+ - "15432:5432"
+ depends_on:
+ - database_data
+ volumes_from:
+ - database_data:rw
+
+ opennms_data:
+ image: tianon/true
+ volumes:
+ - /var/log/opennms
+ - /var/opennms/rrd
+ - /var/opennms/reports
+
+ opennms:
+ build: ./opennms
+ env_file:
+ - ./opennms/env/opennms.env
+ - ./opennms/env/postgres.env
+ depends_on:
+ - database
+ - opennms_data
+ volumes_from:
+ - opennms_data:rw
+ volumes:
+ - ./opennms/etc:/tmp/opennms/etc
+ ports:
+ - "8980:8980"
+ - "18980:18980"
+ - "1099:1099"
+ - "18101:8101"
+ - "61616:61616"
+ - "5817:5817"
+ - "162:162/udp"
diff --git a/compose/elasticsearch/README.md b/compose/elasticsearch/README.md
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/compose/elasticsearch/README.md
diff --git a/compose/elasticsearch/logstash/Dockerfile b/compose/elasticsearch/logstash/Dockerfile
new file mode 100644
index 0000000..ad7cb1c
--- /dev/null
+++ b/compose/elasticsearch/logstash/Dockerfile
@@ -0,0 +1,5 @@
+# Build from latest stable load
+FROM docker.elastic.co/logstash/logstash:5.2.2
+
+# Add logstash plugins
+RUN logstash-plugin install logstash-output-opennms
diff --git a/compose/elasticsearch/logstash/config/logstash.conf b/compose/elasticsearch/logstash/config/logstash.conf
new file mode 100644
index 0000000..e822fe9
--- /dev/null
+++ b/compose/elasticsearch/logstash/config/logstash.conf
@@ -0,0 +1,110 @@
+## ------------------------------------------
+## Retrieve messages from Voltha alarm topic
+## ------------------------------------------
+
+input {
+ kafka {
+ bootstrap_servers => "10.100.198.220:9092"
+ topics => ["voltha.alarms"]
+ tags => [ "alarm" ]
+ type => "voltha_alarms"
+ }
+}
+
+## ------------------------------------------
+## The message field is a JSON block.
+## Break it down in multiple fields
+## for easy extraction
+## ------------------------------------------
+
+filter {
+ json{
+ source => "message"
+ }
+}
+
+## ------------------------------------------
+## Intercept alarm messages and manipulate
+## the content prior to injection in OpenNMS
+## ------------------------------------------
+
+filter {
+ if "alarm" in [tags] {
+ mutate {
+ add_field => { "[@metadata][alarm_id]" => "%{id}" }
+ add_field => { "[@metadata][resource_id]" => "%{resource_id}" }
+ add_field => { "[@metadata][description]" => "%{description}" }
+ add_field => { "[@metadata][type]" => "%{type}" }
+ add_field => { "[@metadata][category]" => "%{category}" }
+ add_field => { "[@metadata][state]" => "%{state}" }
+ add_field => { "[@metadata][raised_time]" => "%{raised_ts}" }
+ add_field => { "[@metadata][reported_time]" => "%{reported_ts}" }
+ add_field => { "[@metadata][changed_time]" => "%{changed_ts}" }
+ add_field => { "[@metadata][context]" => "%{context}" }
+ add_field => { "[@metadata][service]" => "voltha" }
+ add_field => { "[@metadata][interface]" => "localhost" }
+ add_tag => "opennms"
+ }
+
+ if [state] == "RAISED" {
+ mutate {
+ add_field => { "[@metadata][uei]" => "uei.opennms.org/vendor/voltha/alarmRaised" }
+ add_field => { "[@metadata][severity]" => "%{severity}" }
+ }
+ } else if [state] == "CLEARED" {
+ mutate {
+ add_field => { "[@metadata][uei]" => "uei.opennms.org/vendor/voltha/alarmCleared" }
+ add_field => { "[@metadata][severity]" => "Normal" }
+ }
+ }
+ }
+}
+
+## ------------------------------------------
+## View incoming messages (for debugging)
+## ------------------------------------------
+
+output {
+ stdout {
+ codec => rubydebug { metadata => true }
+ }
+}
+
+## ------------------------------------------
+## Forward alarm messages to OpenNMS
+## ------------------------------------------
+
+output {
+ if "opennms" in [tags] {
+ opennms {
+ opennms_server_hosts => {
+ "10.100.198.220" => 5817
+ }
+
+ opennms_event_timezone => "utc"
+ opennms_event_service => "[@metadata][service]"
+ opennms_event_nodeid => 0
+ opennms_event_interface => "[@metadata][interface]"
+ opennms_event_uei => "[@metadata][uei]"
+ opennms_event_severity => "[@metadata][severity]"
+ opennms_event_description => "[@metadata][description]"
+ opennms_event_logmsg => "logmsg"
+
+ opennms_event_parms => {
+ "AlarmId" => "[@metadata][alarm_id]"
+ "ResourceId" => "[@metadata][resource_id]"
+ "Description" => "[@metadata][description]"
+ "Type" => "[@metadata][type]"
+ "Category" => "[@metadata][category]"
+ "State" => "[@metadata][state]"
+ "Severity" => "[@metadata][severity]"
+ "RaisedTime" => "[@metadata][raised_time]"
+ "ReportedTime" => "[@metadata][reported_time]"
+ "ChangedTime" => "[@metadata][changed_time]"
+ "Context" => "[@metadata][context]"
+ }
+
+ opennms_event_parms_order => [ "AlarmId", "ResourceId", "Description", "Type", "Category", "State", "Severity", "RaisedTime", "ReportedTime", "ChangedTime", "Context" ]
+ }
+ }
+}
diff --git a/compose/opennms/Dockerfile b/compose/opennms/Dockerfile
new file mode 100644
index 0000000..241d4e2
--- /dev/null
+++ b/compose/opennms/Dockerfile
@@ -0,0 +1,14 @@
+# Build from latest stable load
+FROM opennms/horizon-core-web:19.0.1-1
+
+# Install supervisord
+RUN yum install -y python-setuptools
+RUN easy_install supervisor
+RUN mkdir -p /var/log/supervisor
+COPY env/supervisord.conf /etc/supervisor/supervisord.conf
+
+# Copy a new startup script to override the default entrypoint script
+COPY env/opennms_start.sh /
+RUN chmod 755 /opennms_start.sh
+
+ENTRYPOINT ["/usr/bin/supervisord"]
diff --git a/compose/opennms/env/opennms.env b/compose/opennms/env/opennms.env
new file mode 100644
index 0000000..66d6fa8
--- /dev/null
+++ b/compose/opennms/env/opennms.env
@@ -0,0 +1,8 @@
+# Environment variables for OpenNMS database connection
+OPENNMS_DBNAME=opennms
+OPENNMS_DBUSER=opennms
+OPENNMS_DBPASS=opennms
+OPENNMS_HOME=/opt/opennms
+OPENNMS_DB_CONFIG=/opt/opennms/etc/opennms-datasources.xml
+opennms.rtc.event.proxy.host=0.0.0.0
+
diff --git a/compose/opennms/env/opennms_start.sh b/compose/opennms/env/opennms_start.sh
new file mode 100644
index 0000000..0b1ea0e
--- /dev/null
+++ b/compose/opennms/env/opennms_start.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+# Initialize the OpenNMS environment and generate necessary configuration files
+/docker-entrypoint.sh -i
+
+# Replace default configuration with customized files
+cp -r /tmp/opennms/etc/* /opt/opennms/etc
+
+# Start OpenNMS
+/docker-entrypoint.sh -f
\ No newline at end of file
diff --git a/compose/opennms/env/postgres.env b/compose/opennms/env/postgres.env
new file mode 100644
index 0000000..8f95df4
--- /dev/null
+++ b/compose/opennms/env/postgres.env
@@ -0,0 +1,5 @@
+# Environment variables for generic PostgreSQL server
+POSTGRES_HOST=database
+POSTGRES_PORT=5432
+POSTGRES_USER=postgres
+POSTGRES_PASSWORD=postgres
diff --git a/compose/opennms/env/supervisord.conf b/compose/opennms/env/supervisord.conf
new file mode 100644
index 0000000..6ef1bfb
--- /dev/null
+++ b/compose/opennms/env/supervisord.conf
@@ -0,0 +1,6 @@
+[supervisord]
+nodaemon=true
+
+[program:opennms_start]
+command=/opennms_start.sh
+stdout_logfile=/dev/stdout
diff --git a/compose/opennms/etc/eventconf.xml b/compose/opennms/etc/eventconf.xml
new file mode 100644
index 0000000..da3d421
--- /dev/null
+++ b/compose/opennms/etc/eventconf.xml
@@ -0,0 +1,252 @@
+<?xml version="1.0"?>
+<events xmlns="http://xmlns.opennms.org/xsd/eventconf">
+ <global>
+ <security>
+ <doNotOverride>logmsg</doNotOverride>
+ <doNotOverride>operaction</doNotOverride>
+ <doNotOverride>autoaction</doNotOverride>
+ <doNotOverride>tticket</doNotOverride>
+ <doNotOverride>script</doNotOverride>
+ </security>
+ </global>
+
+ <event-file>events/opennms.events.xml</event-file>
+ <event-file>events/Translator.default.events.xml</event-file>
+
+ <event-file>events/Rancid.events.xml</event-file>
+ <event-file>events/AlarmChangeNotifierEvents.xml</event-file>
+
+ <event-file>events/3Com.events.xml</event-file>
+ <event-file>events/AdaptecRaid.events.xml</event-file>
+ <event-file>events/ADIC-v2.events.xml</event-file>
+ <event-file>events/Adtran.events.xml</event-file>
+ <event-file>events/Adtran.Atlas.events.xml</event-file>
+ <event-file>events/Aedilis.events.xml</event-file>
+ <event-file>events/AirDefense.events.xml</event-file>
+ <event-file>events/AIX.events.xml</event-file>
+ <event-file>events/AKCP.events.xml</event-file>
+ <event-file>events/AlcatelLucent.OmniSwitch.events.xml</event-file>
+ <event-file>events/AlcatelLucent.SMSBrick.events.xml</event-file>
+ <event-file>events/Allot.events.xml</event-file>
+ <event-file>events/Allot.NetXplorer.events.xml</event-file>
+ <event-file>events/Allot.SM.events.xml</event-file>
+ <event-file>events/Alteon.events.xml</event-file>
+ <event-file>events/Altiga.events.xml</event-file>
+ <event-file>events/APC.events.xml</event-file>
+ <event-file>events/APC.Best.events.xml</event-file>
+ <event-file>events/APC.Exide.events.xml</event-file>
+ <event-file>events/ApacheHTTPD.syslog.events.xml</event-file>
+ <event-file>events/Aruba.AP.events.xml</event-file>
+ <event-file>events/Aruba.Switch.events.xml</event-file>
+ <event-file>events/Aruba.events.xml</event-file>
+ <event-file>events/Ascend.events.xml</event-file>
+ <event-file>events/Avocent.ACS.events.xml</event-file>
+ <event-file>events/Avocent.ACS5000.events.xml</event-file>
+ <event-file>events/Avocent.AMX5000.events.xml</event-file>
+ <event-file>events/Avocent.AMX5010.events.xml</event-file>
+ <event-file>events/Avocent.AMX5020.events.xml</event-file>
+ <event-file>events/Avocent.AMX5030.events.xml</event-file>
+ <event-file>events/Avocent.CCM.events.xml</event-file>
+ <event-file>events/Avocent.DSR.events.xml</event-file>
+ <event-file>events/Avocent.DSR1021.events.xml</event-file>
+ <event-file>events/Avocent.DSR2010.events.xml</event-file>
+ <event-file>events/Avocent-DSView.events.xml</event-file>
+ <event-file>events/Avocent.Mergepoint.events.xml</event-file>
+ <event-file>events/Avocent.PMTrap.events.xml</event-file>
+ <event-file>events/Audiocodes.events.xml</event-file>
+ <event-file>events/A10.AX.events.xml</event-file>
+ <event-file>events/ATMForum.events.xml</event-file>
+ <event-file>events/BackupExec.events.xml</event-file>
+ <event-file>events/BEA.events.xml</event-file>
+ <event-file>events/BGP4.events.xml</event-file>
+ <event-file>events/BlackBerryServer-SMIv2.events.xml</event-file>
+ <event-file>events/BlackBerryServer.events.xml</event-file>
+ <event-file>events/BladeNetwork.events.xml</event-file>
+ <event-file>events/Bluecat.events.xml</event-file>
+ <event-file>events/BlueCoat.events.xml</event-file>
+ <event-file>events/Brocade.events.xml</event-file>
+ <event-file>events/Broadcom-BASPTrap.events.xml</event-file>
+ <event-file>events/CA.ArcServe.events.xml</event-file>
+ <event-file>events/Ceragon-FA1500.events.xml</event-file>
+ <event-file>events/Cisco.airespace.xml</event-file>
+ <event-file>events/Cisco.CIDS.events.xml</event-file>
+ <event-file>events/Cisco.5300dchan.events.xml</event-file>
+ <event-file>events/Cisco.mcast.events.xml</event-file>
+ <event-file>events/Cisco.SCE.events.xml</event-file>
+ <event-file>events/Cisco2.events.xml</event-file>
+ <event-file>events/Cisco.events.xml</event-file>
+ <event-file>events/CitrixNetScaler.events.xml</event-file>
+ <event-file>events/Colubris.events.xml</event-file>
+ <event-file>events/ComtechEFData.events.xml</event-file>
+ <event-file>events/Concord.events.xml</event-file>
+ <event-file>events/Covergence.events.xml</event-file>
+ <event-file>events/CPQHPIM.events.xml</event-file>
+ <event-file>events/Clarent.events.xml</event-file>
+ <event-file>events/Clarinet.events.xml</event-file>
+ <event-file>events/Clavister.events.xml</event-file>
+ <event-file>events/Compuware.events.xml</event-file>
+ <event-file>events/Cricket.events.xml</event-file>
+ <event-file>events/CRITAPP.events.xml</event-file>
+ <event-file>events/Crossbeam.events.xml</event-file>
+ <event-file>events/Dell-Asf.events.xml</event-file>
+ <event-file>events/DellArrayManager.events.xml</event-file>
+ <event-file>events/DellEquallogic.events.xml</event-file>
+ <event-file>events/Dell-DRAC2.events.xml</event-file>
+ <event-file>events/Dell-ITassist.events.xml</event-file>
+ <event-file>events/Dell-F10-bgb4-v2.events.xml</event-file>
+ <event-file>events/Dell-F10-chassis.events.xml</event-file>
+ <event-file>events/Dell-F10-copy-config.events.xml</event-file>
+ <event-file>events/Dell-F10-mstp.events.xml</event-file>
+ <event-file>events/Dell-F10-system-component.events.xml</event-file>
+ <event-file>events/DellOpenManage.events.xml</event-file>
+ <event-file>events/DellRacHost.events.xml</event-file>
+ <event-file>events/DellStorageManagement.events.xml</event-file>
+ <event-file>events/DISMAN.events.xml</event-file>
+ <event-file>events/DISMAN-PING.events.xml</event-file>
+ <event-file>events/Dlink.events.xml</event-file>
+ <event-file>events/DMTF.events.xml</event-file>
+ <event-file>events/DPS.events.xml</event-file>
+ <event-file>events/DS1.events.xml</event-file>
+ <event-file>events/EMC.events.xml</event-file>
+ <event-file>events/EMC-Celerra.events.xml</event-file>
+ <event-file>events/EMC-Clariion.events.xml</event-file>
+ <event-file>events/Evertz.7780ASI-IP2.events.xml</event-file>
+ <event-file>events/Evertz.7880IP-ASI-IP.events.xml</event-file>
+ <event-file>events/Evertz.7880IP-ASI-IP-FR.events.xml</event-file>
+ <event-file>events/Evertz.7881DEC-MP2-HD.events.xml</event-file>
+ <event-file>events/Extreme.events.xml</event-file>
+ <event-file>events/F5.events.xml</event-file>
+ <event-file>events/fcmgmt.events.xml</event-file>
+ <event-file>events/Fore.events.xml</event-file>
+ <event-file>events/Fortinet-FortiCore-v52.events.xml</event-file>
+ <event-file>events/Fortinet-FortiGate-v52.events.xml</event-file>
+ <event-file>events/Fortinet-FortiMail.events.xml</event-file>
+ <event-file>events/Fortinet-FortiManager-Analyzer.events.xml</event-file>
+ <event-file>events/Fortinet-FortiRecorder.events.xml</event-file>
+ <event-file>events/Fortinet-FortiVoice.events.xml</event-file>
+ <event-file>events/Fortinet-FortiCore-v4.events.xml</event-file>
+ <event-file>events/Fortinet-FortiGate-v4.events.xml</event-file>
+ <event-file>events/FoundryNetworks.events.xml</event-file>
+ <event-file>events/FoundryNetworks2.events.xml</event-file>
+ <event-file>events/FujitsuSiemens.events.xml</event-file>
+ <event-file>events/GGSN.events.xml</event-file>
+ <event-file>events/Groupwise.events.xml</event-file>
+ <event-file>events/HP.events.xml</event-file>
+ <event-file>events/HWg.Poseidon.events.xml</event-file>
+ <event-file>events/Hyperic.events.xml</event-file>
+ <event-file>events/IBM.events.xml</event-file>
+ <event-file>events/IBM-UMS.events.xml</event-file>
+ <event-file>events/IBMRSA2.events.xml</event-file>
+ <event-file>events/IEEE802dot11.events.xml</event-file>
+ <event-file>events/Infoblox.events.xml</event-file>
+ <event-file>events/Intel.events.xml</event-file>
+ <event-file>events/INTEL-LAN-ADAPTERS-MIB.events.xml</event-file>
+ <event-file>events/InteractiveIntelligence.events.xml</event-file>
+ <event-file>events/IronPort.events.xml</event-file>
+ <event-file>events/ISS.events.xml</event-file>
+ <event-file>events/IPUnity-SES-MIB.events.xml</event-file>
+ <event-file>events/IPV6.events.xml</event-file>
+ <event-file>events/Juniper.mcast.events.xml</event-file>
+ <event-file>events/Juniper.events.xml</event-file>
+ <event-file>events/Juniper.ive.events.xml</event-file>
+ <event-file>events/Juniper.screen.events.xml</event-file>
+ <event-file>events/Junos.events.xml</event-file>
+ <event-file>events/JunosV1.events.xml</event-file>
+ <event-file>events/K5Systems.events.xml</event-file>
+ <event-file>events/Konica.events.xml</event-file>
+ <event-file>events/LLDP.events.xml</event-file>
+ <event-file>events/Liebert.events.xml</event-file>
+ <event-file>events/Liebert.600SM.events.xml</event-file>
+ <event-file>events/Linksys.events.xml</event-file>
+ <event-file>events/LinuxKernel.syslog.events.xml</event-file>
+ <event-file>events/Lucent.events.xml</event-file>
+ <event-file>events/MadgeNetworks.events.xml</event-file>
+ <event-file>events/McAfee.events.xml</event-file>
+ <event-file>events/MGE-UPS.events.xml</event-file>
+ <event-file>events/Microsoft.events.xml</event-file>
+ <event-file>events/MikrotikRouterOS.events.xml</event-file>
+ <event-file>events/Multicast.standard.events.xml</event-file>
+ <event-file>events/MPLS.events.xml</event-file>
+ <event-file>events/MRV.events.xml</event-file>
+ <event-file>events/MSDP.events.xml</event-file>
+ <event-file>events/Mylex.events.xml</event-file>
+ <event-file>events/NetApp.events.xml</event-file>
+ <event-file>events/Netbotz.events.xml</event-file>
+ <event-file>events/Netgear.events.xml</event-file>
+ <event-file>events/NetgearProsafeSmartSwitch.events.xml</event-file>
+ <event-file>events/NetgearProsafeSmartSwitch.syslog.events.xml</event-file>
+ <event-file>events/Netscreen.events.xml</event-file>
+ <event-file>events/NetSNMP.events.xml</event-file>
+ <event-file>events/Nokia.events.xml</event-file>
+ <event-file>events/NORTEL.Contivity.events.xml</event-file>
+ <event-file>events/Novell.events.xml</event-file>
+ <event-file>events/OpenNMSMIB.events.xml</event-file>
+ <event-file>events/OpenSSH.syslog.events.xml</event-file>
+ <event-file>events/OpenWrt.syslog.events.xml</event-file>
+ <event-file>events/Oracle.events.xml</event-file>
+ <event-file>events/OSPF.events.xml</event-file>
+ <event-file>events/Overland.events.xml</event-file>
+ <event-file>events/Overture.events.xml</event-file>
+ <event-file>events/Procmail.syslog.events.xml</event-file>
+ <event-file>events/POSIX.syslog.events.xml</event-file>
+ <event-file>events/Postfix.syslog.events.xml</event-file>
+ <event-file>events/Packeteer.events.xml</event-file>
+ <event-file>events/Patrol.events.xml</event-file>
+ <event-file>events/PCube.events.xml</event-file>
+ <event-file>events/Pingtel.events.xml</event-file>
+ <event-file>events/Pixelmetrix.events.xml</event-file>
+ <event-file>events/Polycom.events.xml</event-file>
+ <event-file>events/Powerware.events.xml</event-file>
+ <event-file>events/Primecluster.events.xml</event-file>
+ <event-file>events/Quintum.events.xml</event-file>
+ <event-file>events/Raytheon.events.xml</event-file>
+ <event-file>events/RADLAN-MIB.events.xml</event-file>
+ <event-file>events/RAPID-CITY.events.xml</event-file>
+ <event-file>events/Redline.events.xml</event-file>
+ <event-file>events/RFC1382.events.xml</event-file>
+ <event-file>events/RFC1628.events.xml</event-file>
+ <event-file>events/Rightfax.events.xml</event-file>
+ <event-file>events/RiverbedSteelhead.events.xml</event-file>
+ <event-file>events/RMON.events.xml</event-file>
+ <event-file>events/Sensaphone.events.xml</event-file>
+ <event-file>events/Sentry.events.xml</event-file>
+ <event-file>events/Siemens-HiPath3000.events.xml</event-file>
+ <event-file>events/Siemens-HiPath3000-HG1500.events.xml</event-file>
+ <event-file>events/Siemens-HiPath4000.events.xml</event-file>
+ <event-file>events/Siemens-HiPath8000-OpenScapeVoice.events.xml</event-file>
+ <event-file>events/SNA-NAU.events.xml</event-file>
+ <event-file>events/SNMP-REPEATER.events.xml</event-file>
+ <event-file>events/Snort.events.xml</event-file>
+ <event-file>events/SonicWall.events.xml</event-file>
+ <event-file>events/Sonus.events.xml</event-file>
+ <event-file>events/Sudo.syslog.events.xml</event-file>
+ <event-file>events/SunILOM.events.xml</event-file>
+ <event-file>events/Symbol.events.xml</event-file>
+ <event-file>events/Syslogd.events.xml</event-file>
+ <event-file>events/SystemEdge.events.xml</event-file>
+ <event-file>events/SwissQual.events.xml</event-file>
+ <event-file>events/TransPath.events.xml</event-file>
+ <event-file>events/Trendmicro.events.xml</event-file>
+ <event-file>events/TrippLite.events.xml</event-file>
+ <event-file>events/TUT.events.xml</event-file>
+ <event-file>events/UPS-MIB.events.xml</event-file>
+ <event-file>events/Uptime.events.xml</event-file>
+ <event-file>events/Veeam_Backup-Replication.events.xml</event-file>
+ <event-file>events/Veraz.events.xml</event-file>
+ <event-file>events/VMWare.env.events.xml</event-file>
+ <event-file>events/VMWare.vc.events.xml</event-file>
+ <event-file>events/VMWare.vminfo.events.xml</event-file>
+ <event-file>events/VMWare.obsolete.events.xml</event-file>
+ <event-file>events/VMWare.events.xml</event-file>
+ <event-file>events/Waverider.3000.events.xml</event-file>
+ <event-file>events/Websense.events.xml</event-file>
+ <event-file>events/Xerox-V2.events.xml</event-file>
+ <event-file>events/Xerox.events.xml</event-file>
+
+ <event-file>events/topology-status.events.xml</event-file>
+ <event-file>events/ncs-component.events.xml</event-file>
+ <event-file>events/asset-management.events.xml</event-file>
+ <event-file>events/Standard.events.xml</event-file>
+ <event-file>events/default.events.xml</event-file>
+ <event-file>events/voltha.events.xml</event-file>
+</events>
diff --git a/compose/opennms/etc/eventd-configuration.xml b/compose/opennms/etc/eventd-configuration.xml
new file mode 100644
index 0000000..d9d40e5
--- /dev/null
+++ b/compose/opennms/etc/eventd-configuration.xml
@@ -0,0 +1,10 @@
+<EventdConfiguration
+ TCPAddress="0.0.0.0"
+ TCPPort="5817"
+ UDPAddress="0.0.0.0"
+ UDPPort="5817"
+ receivers="5"
+ getNextEventID="SELECT nextval('eventsNxtId')"
+ socketSoTimeoutRequired="yes"
+ socketSoTimeoutPeriod="3000">
+</EventdConfiguration>
diff --git a/compose/opennms/etc/events/voltha.events.xml b/compose/opennms/etc/events/voltha.events.xml
new file mode 100644
index 0000000..c24ae42
--- /dev/null
+++ b/compose/opennms/etc/events/voltha.events.xml
@@ -0,0 +1,113 @@
+<events xmlns="http://xmlns.opennms.org/xsd/eventconf">
+ <!-- output events: Linux -->
+ <event>
+ <uei>uei.opennms.org/vendor/voltha/alarmRaised</uei>
+ <event-label>vOLT-HA - Alarm Raised Event</event-label>
+ <descr>
+ AlarmId: %parm[AlarmId]%<br/>
+ ResourceId: %parm[ResourceId]%<br/>
+ Description: %parm[Description]%<br/>
+ Type: %parm[Type]%<br/>
+ Category: %parm[Category]%<br/>
+ State: %parm[State]%<br/>
+ Severity: %parm[Severity]%<br/>
+ RaisedTime: %parm[RaisedTime]%<br/>
+ ReportedTime: %parm[ReportedTime]%<br/>
+ ChangedTime: %parm[ChangedTime]%<br/>
+ Context: %parm[Context]%<br/>
+ </descr>
+ <logmsg dest='donotpersist'>
+ %parm[Description]%<br/>
+ Type: %parm[Type]%
+ </logmsg>
+ <severity>Warning</severity>
+ <operinstruct></operinstruct>
+ <alarm-data reduction-key="%uei%:%nodeid%:%parm[AlarmId]%:%parm[ResourceId]%:%parm[Type]%:%parm[Category]%" alarm-type="1" auto-clean="false">
+ <update-field field-name="severity" update-on-reduction="true"/>
+ </alarm-data>
+ </event>
+ <event>
+ <uei>uei.opennms.org/vendor/voltha/alarmRaisedCorrelated</uei>
+ <event-label>vOLT-HA - Alarm Raised and Correlated Event</event-label>
+ <descr>
+ AlarmId: %parm[AlarmId]%<br/>
+ ResourceId: %parm[ResourceId]%<br/>
+ Description: %parm[Description]%<br/>
+ Type: %parm[Type]%<br/>
+ Category: %parm[Category]%<br/>
+ State: %parm[State]%<br/>
+ Severity: %parm[Severity]%<br/>
+ RaisedTime: %parm[RaisedTime]%<br/>
+ ReportedTime: %parm[ReportedTime]%<br/>
+ ChangedTime: %parm[ChangedTime]%<br/>
+ Context: %parm[Context]%<br/>
+ </descr>
+ <logmsg dest='logndisplay'>
+ %parm[Description]%<br/>
+ Type: %parm[Type]%
+ </logmsg>
+ <severity>Warning</severity>
+ <operinstruct></operinstruct>
+ <alarm-data reduction-key="%uei%:%nodeid%:%parm[AlarmId]%:%parm[ResourceId]%:%parm[Type]%:%parm[Category]%" alarm-type="1" auto-clean="false">
+ <update-field field-name="severity" update-on-reduction="true"/>
+ </alarm-data>
+ </event>
+ <event>
+ <uei>uei.opennms.org/vendor/voltha/alarmCleared</uei>
+ <event-label>vOLT-HA - Alarm Cleared Event</event-label>
+ <descr>
+ AlarmId: %parm[AlarmId]%<br/>
+ ResourceId: %parm[ResourceId]%<br/>
+ Description: %parm[Description]%<br/>
+ Type: %parm[Type]%<br/>
+ Category: %parm[Category]%<br/>
+ State: %parm[State]%<br/>
+ Severity: %parm[Severity]%<br/>
+ RaisedTime: %parm[RaisedTime]%<br/>
+ ReportedTime: %parm[ReportedTime]%<br/>
+ ChangedTime: %parm[ChangedTime]%<br/>
+ Context: %parm[Context]%<br/>
+ </descr>
+ <logmsg dest='donotpersist'>
+ %parm[Description]%<br/>
+ Type: %parm[Type]%
+ </logmsg>
+ <severity>Normal</severity>
+ <operinstruct></operinstruct>
+ <alarm-data reduction-key="%uei%:%nodeid%:%parm[AlarmId]%:%parm[ResourceId]%:%parm[Type]%:%parm[Category]%"
+ alarm-type="2"
+ clear-key="uei.opennms.org/vendor/voltha/alarmRaised:%nodeid%:%parm[AlarmId]%:%parm[ResourceId]%:%parm[Type]%:%parm[Category]%"
+ auto-clean="true">
+ <update-field field-name="severity" update-on-reduction="true"/>
+ </alarm-data>
+ </event>
+ <event>
+ <uei>uei.opennms.org/vendor/voltha/alarmClearedCorrelated</uei>
+ <event-label>vOLT-HA - Alarm Cleared and Correlated Event</event-label>
+ <descr>
+ AlarmId: %parm[AlarmId]%<br/>
+ ResourceId: %parm[ResourceId]%<br/>
+ Description: %parm[Description]%<br/>
+ Type: %parm[Type]%<br/>
+ Category: %parm[Category]%<br/>
+ State: %parm[State]%<br/>
+ Severity: %parm[Severity]%<br/>
+ RaisedTime: %parm[RaisedTime]%<br/>
+ ReportedTime: %parm[ReportedTime]%<br/>
+ ChangedTime: %parm[ChangedTime]%<br/>
+ Context: %parm[Context]%<br/>
+ </descr>
+ <logmsg dest='logndisplay'>
+ %parm[Description]%<br/>
+ Type: %parm[Type]%
+ </logmsg>
+ <severity>Normal</severity>
+ <operinstruct></operinstruct>
+ <alarm-data reduction-key="%uei%:%nodeid%:%parm[AlarmId]%:%parm[ResourceId]%:%parm[Type]%:%parm[Category]%"
+ alarm-type="2"
+ clear-key="uei.opennms.org/vendor/voltha/alarmRaisedCorrelated:%nodeid%:%parm[AlarmId]%:%parm[ResourceId]%:%parm[Type]%:%parm[Category]%"
+ auto-clean="true">
+ <update-field field-name="severity" update-on-reduction="true"/>
+ </alarm-data>
+ </event>
+</events>
diff --git a/compose/opennms/etc/translator-configuration.xml b/compose/opennms/etc/translator-configuration.xml
new file mode 100644
index 0000000..b536a99
--- /dev/null
+++ b/compose/opennms/etc/translator-configuration.xml
@@ -0,0 +1,163 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<event-translator-configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://xmlns.opennms.org/xsd/translator-configuration http://www.opennms.org/xsd/config/translator-configuration.xsd ">
+
+ <!-- Improved LinkDown/LinkUp events. Uses translator to add DB information to link status traps events -->
+ <translation>
+ <event-translation-spec uei="uei.opennms.org/generic/traps/SNMP_Link_Down">
+ <mappings>
+ <mapping>
+ <assignment name="uei" type="field" >
+ <value type="constant" result="uei.opennms.org/translator/traps/SNMP_Link_Down" />
+ </assignment>
+ <assignment name="ifDescr" type="parameter">
+ <value type="sql" result="SELECT snmp.snmpIfDescr FROM snmpInterface snmp WHERE snmp.nodeid = ?::integer AND snmp.snmpifindex = ?::integer" >
+ <value type="field" name="nodeid" matches=".*" result="${0}" />
+ <value type="parameter" name="~^\.1\.3\.6\.1\.2\.1\.2\.2\.1\.1\.([0-9]*)$" matches=".*" result="${0}" />
+ </value>
+ </assignment>
+ <assignment name="ifName" type="parameter">
+ <value type="sql" result="SELECT snmp.snmpIfName FROM snmpInterface snmp WHERE snmp.nodeid = ?::integer AND snmp.snmpifindex = ?::integer" >
+ <value type="field" name="nodeid" matches=".*" result="${0}" />
+ <value type="parameter" name="~^\.1\.3\.6\.1\.2\.1\.2\.2\.1\.1\.([0-9]*)$" matches=".*" result="${0}" />
+ </value>
+ </assignment>
+ <assignment name="ifAlias" type="parameter">
+ <value type="sql" result="SELECT snmp.snmpIfAlias FROM snmpInterface snmp WHERE snmp.nodeid = ?::integer AND snmp.snmpifindex = ?::integer" >
+ <value type="field" name="nodeid" matches=".*" result="${0}" />
+ <value type="parameter" name="~^\.1\.3\.6\.1\.2\.1\.2\.2\.1\.1\.([0-9]*)$" matches=".*" result="${0}" />
+ </value>
+ </assignment>
+ </mapping>
+ <mapping>
+ <assignment name="uei" type="field" >
+ <value type="constant" result="uei.opennms.org/internal/topology/linkDown" />
+ </assignment>
+ </mapping>
+ </mappings>
+ </event-translation-spec>
+ <event-translation-spec uei="uei.opennms.org/generic/traps/SNMP_Link_Up">
+ <mappings>
+ <mapping>
+ <assignment name="uei" type="field" >
+ <value type="constant" result="uei.opennms.org/translator/traps/SNMP_Link_Up" />
+ </assignment>
+ <assignment name="ifDescr" type="parameter">
+ <value type="sql" result="SELECT snmp.snmpIfDescr FROM snmpInterface snmp WHERE snmp.nodeid = ?::integer AND snmp.snmpifindex = ?::integer" >
+ <value type="field" name="nodeid" matches=".*" result="${0}" />
+ <value type="parameter" name="~^\.1\.3\.6\.1\.2\.1\.2\.2\.1\.1\.([0-9]*)$" matches=".*" result="${0}" />
+ </value>
+ </assignment>
+ <assignment name="ifName" type="parameter">
+ <value type="sql" result="SELECT snmp.snmpIfName FROM snmpInterface snmp WHERE snmp.nodeid = ?::integer AND snmp.snmpifindex = ?::integer" >
+ <value type="field" name="nodeid" matches=".*" result="${0}" />
+ <value type="parameter" name="~^\.1\.3\.6\.1\.2\.1\.2\.2\.1\.1\.([0-9]*)$" matches=".*" result="${0}" />
+ </value>
+ </assignment>
+ <assignment name="ifAlias" type="parameter">
+ <value type="sql" result="SELECT snmp.snmpIfAlias FROM snmpInterface snmp WHERE snmp.nodeid = ?::integer AND snmp.snmpifindex = ?::integer" >
+ <value type="field" name="nodeid" matches=".*" result="${0}" />
+ <value type="parameter" name="~^\.1\.3\.6\.1\.2\.1\.2\.2\.1\.1\.([0-9]*)$" matches=".*" result="${0}" />
+ </value>
+ </assignment>
+ </mapping>
+ <mapping>
+ <assignment name="uei" type="field" >
+ <value type="constant" result="uei.opennms.org/internal/topology/linkUp" />
+ </assignment>
+ </mapping>
+ </mappings>
+ </event-translation-spec>
+
+ <!-- This translation is predifined for integration with Hyperic-HQ server and the OpenNMS integrations found in
+ the $OPENNMS_HOME/contrib/hyperic-integration directory -->
+ <event-translation-spec uei="uei.opennms.org/external/hyperic/alert">
+ <mappings>
+ <mapping>
+ <assignment name="uei" type="field" >
+ <value type="constant" result="uei.opennms.org/internal/translator/hypericAlert" />
+ </assignment>
+ <assignment name="nodeid" type="field" >
+ <value type="sql" result="SELECT n.nodeid FROM node n WHERE n.foreignid = ? AND n.foreignsource = ?" >
+ <value type="parameter" name="platform.id" matches=".*" result="${0}" />
+ <value type="parameter" name="alert.source" matches=".*" result="${0}" />
+ </value>
+ </assignment>
+ </mapping>
+ </mappings>
+ </event-translation-spec>
+
+ <!-- Translations for configuration management -->
+ <event-translation-spec uei="uei.opennms.org/vendor/Cisco/traps/ciscoConfigManEvent" >
+ <mappings>
+ <mapping>
+ <assignment name="uei" type="field" >
+ <value type="constant" result="uei.opennms.org/internal/translator/entityConfigChanged" />
+ </assignment>
+ <assignment name="configSource" type="parameter" >
+ <!-- ccmHistoryEventCommandSource -->
+ <value type="parameter" name="~^\.1\.3\.6\.1\.4\.1\.9\.9\.43\.1\.1\.6\.1\.3\..*" matches=".*" result="${0}" />
+ </assignment>
+ <assignment name="configUser" type="parameter" >
+ <value type="constant" result="Unknown" />
+ </assignment>
+ </mapping>
+ </mappings>
+ </event-translation-spec>
+ <event-translation-spec uei="uei.opennms.org/vendor/Juniper/traps/jnxCmCfgChange" >
+ <mappings>
+ <mapping>
+ <assignment name="uei" type="field" >
+ <value type="constant" result="uei.opennms.org/internal/translator/entityConfigChanged" />
+ </assignment>
+ <assignment name="configSource" type="parameter" >
+ <value type="parameter" name="~^\.1\.3\.6\.1\.4\.1\.2636\.3\.18\.1\.7\.1\.4\..*" matches=".*" result="${0}" />
+ </assignment>
+ <assignment name="configUser" type="parameter" >
+ <value type="parameter" name="~^\.1\.3\.6\.1\.4\.1\.2636\.3\.18\.1\.7\.1\.5\..*" matches=".*" result="${0}" />
+ </assignment>
+ </mapping>
+ </mappings>
+ </event-translation-spec>
+
+ <!-- VOLTHA translators to attach the nodeid value to an alarm -->
+ <event-translation-spec uei="uei.opennms.org/vendor/voltha/alarmRaised">
+ <mappings>
+ <mapping>
+ <assignment type="field" name="nodeid">
+ <value type="sql" result="select case when b.count > 0 then b.nodeid else 0 end as nodeid from (select nodeid, a.nodelabel, count from node right outer join (select cast(? as text) as nodelabel, count(*) from node where nodelabel=?) as a on node.nodelabel=a.nodelabel) as b">
+ <value type="parameter" name="ResourceId" matches=".*" result="${0}"/>
+ <value type="parameter" name="ResourceId" matches=".*" result="${0}"/>
+ </value>
+ </assignment>
+ <assignment type="field" name="uei">
+ <value type="constant" result="uei.opennms.org/vendor/voltha/alarmRaisedCorrelated"/>
+ </assignment>
+ <assignment type="field" name="severity">
+ <value type="field" name="severity" matches=".*" result="${0}" />
+ </assignment>
+ </mapping>
+ </mappings>
+ </event-translation-spec>
+ <event-translation-spec uei="uei.opennms.org/vendor/voltha/alarmCleared">
+ <mappings>
+ <mapping>
+ <assignment type="field" name="nodeid">
+ <value type="sql" result="select case when b.count > 0 then b.nodeid else 0 end as nodeid from (select nodeid, a.nodelabel, count from node right outer join (select cast(? as text) as nodelabel, count(*) from node where nodelabel=?) as a on node.nodelabel=a.nodelabel) as b">
+ <value type="parameter" name="ResourceId" matches=".*" result="${0}"/>
+ <value type="parameter" name="ResourceId" matches=".*" result="${0}"/>
+ </value>
+ </assignment>
+ <assignment type="field" name="uei">
+ <value type="constant" result="uei.opennms.org/vendor/voltha/alarmClearedCorrelated"/>
+ </assignment>
+ <assignment type="field" name="severity">
+ <value type="field" name="severity" matches=".*" result="${0}" />
+ </assignment>
+ </mapping>
+ </mappings>
+ </event-translation-spec>
+
+ </translation>
+
+</event-translator-configuration>