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