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/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>