blob: b536a998813fa9c110bd23127fad82e3b329631d [file] [log] [blame]
Stephane Barbarie3eab2bb2017-04-24 15:04:23 -04001<?xml version="1.0" encoding="UTF-8"?>
2<event-translator-configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3 xsi:schemaLocation="http://xmlns.opennms.org/xsd/translator-configuration http://www.opennms.org/xsd/config/translator-configuration.xsd ">
4
5 <!-- Improved LinkDown/LinkUp events. Uses translator to add DB information to link status traps events -->
6 <translation>
7 <event-translation-spec uei="uei.opennms.org/generic/traps/SNMP_Link_Down">
8 <mappings>
9 <mapping>
10 <assignment name="uei" type="field" >
11 <value type="constant" result="uei.opennms.org/translator/traps/SNMP_Link_Down" />
12 </assignment>
13 <assignment name="ifDescr" type="parameter">
14 <value type="sql" result="SELECT snmp.snmpIfDescr FROM snmpInterface snmp WHERE snmp.nodeid = ?::integer AND snmp.snmpifindex = ?::integer" >
15 <value type="field" name="nodeid" matches=".*" result="${0}" />
16 <value type="parameter" name="~^\.1\.3\.6\.1\.2\.1\.2\.2\.1\.1\.([0-9]*)$" matches=".*" result="${0}" />
17 </value>
18 </assignment>
19 <assignment name="ifName" type="parameter">
20 <value type="sql" result="SELECT snmp.snmpIfName FROM snmpInterface snmp WHERE snmp.nodeid = ?::integer AND snmp.snmpifindex = ?::integer" >
21 <value type="field" name="nodeid" matches=".*" result="${0}" />
22 <value type="parameter" name="~^\.1\.3\.6\.1\.2\.1\.2\.2\.1\.1\.([0-9]*)$" matches=".*" result="${0}" />
23 </value>
24 </assignment>
25 <assignment name="ifAlias" type="parameter">
26 <value type="sql" result="SELECT snmp.snmpIfAlias FROM snmpInterface snmp WHERE snmp.nodeid = ?::integer AND snmp.snmpifindex = ?::integer" >
27 <value type="field" name="nodeid" matches=".*" result="${0}" />
28 <value type="parameter" name="~^\.1\.3\.6\.1\.2\.1\.2\.2\.1\.1\.([0-9]*)$" matches=".*" result="${0}" />
29 </value>
30 </assignment>
31 </mapping>
32 <mapping>
33 <assignment name="uei" type="field" >
34 <value type="constant" result="uei.opennms.org/internal/topology/linkDown" />
35 </assignment>
36 </mapping>
37 </mappings>
38 </event-translation-spec>
39 <event-translation-spec uei="uei.opennms.org/generic/traps/SNMP_Link_Up">
40 <mappings>
41 <mapping>
42 <assignment name="uei" type="field" >
43 <value type="constant" result="uei.opennms.org/translator/traps/SNMP_Link_Up" />
44 </assignment>
45 <assignment name="ifDescr" type="parameter">
46 <value type="sql" result="SELECT snmp.snmpIfDescr FROM snmpInterface snmp WHERE snmp.nodeid = ?::integer AND snmp.snmpifindex = ?::integer" >
47 <value type="field" name="nodeid" matches=".*" result="${0}" />
48 <value type="parameter" name="~^\.1\.3\.6\.1\.2\.1\.2\.2\.1\.1\.([0-9]*)$" matches=".*" result="${0}" />
49 </value>
50 </assignment>
51 <assignment name="ifName" type="parameter">
52 <value type="sql" result="SELECT snmp.snmpIfName FROM snmpInterface snmp WHERE snmp.nodeid = ?::integer AND snmp.snmpifindex = ?::integer" >
53 <value type="field" name="nodeid" matches=".*" result="${0}" />
54 <value type="parameter" name="~^\.1\.3\.6\.1\.2\.1\.2\.2\.1\.1\.([0-9]*)$" matches=".*" result="${0}" />
55 </value>
56 </assignment>
57 <assignment name="ifAlias" type="parameter">
58 <value type="sql" result="SELECT snmp.snmpIfAlias FROM snmpInterface snmp WHERE snmp.nodeid = ?::integer AND snmp.snmpifindex = ?::integer" >
59 <value type="field" name="nodeid" matches=".*" result="${0}" />
60 <value type="parameter" name="~^\.1\.3\.6\.1\.2\.1\.2\.2\.1\.1\.([0-9]*)$" matches=".*" result="${0}" />
61 </value>
62 </assignment>
63 </mapping>
64 <mapping>
65 <assignment name="uei" type="field" >
66 <value type="constant" result="uei.opennms.org/internal/topology/linkUp" />
67 </assignment>
68 </mapping>
69 </mappings>
70 </event-translation-spec>
71
72 <!-- This translation is predifined for integration with Hyperic-HQ server and the OpenNMS integrations found in
73 the $OPENNMS_HOME/contrib/hyperic-integration directory -->
74 <event-translation-spec uei="uei.opennms.org/external/hyperic/alert">
75 <mappings>
76 <mapping>
77 <assignment name="uei" type="field" >
78 <value type="constant" result="uei.opennms.org/internal/translator/hypericAlert" />
79 </assignment>
80 <assignment name="nodeid" type="field" >
81 <value type="sql" result="SELECT n.nodeid FROM node n WHERE n.foreignid = ? AND n.foreignsource = ?" >
82 <value type="parameter" name="platform.id" matches=".*" result="${0}" />
83 <value type="parameter" name="alert.source" matches=".*" result="${0}" />
84 </value>
85 </assignment>
86 </mapping>
87 </mappings>
88 </event-translation-spec>
89
90 <!-- Translations for configuration management -->
91 <event-translation-spec uei="uei.opennms.org/vendor/Cisco/traps/ciscoConfigManEvent" >
92 <mappings>
93 <mapping>
94 <assignment name="uei" type="field" >
95 <value type="constant" result="uei.opennms.org/internal/translator/entityConfigChanged" />
96 </assignment>
97 <assignment name="configSource" type="parameter" >
98 <!-- ccmHistoryEventCommandSource -->
99 <value type="parameter" name="~^\.1\.3\.6\.1\.4\.1\.9\.9\.43\.1\.1\.6\.1\.3\..*" matches=".*" result="${0}" />
100 </assignment>
101 <assignment name="configUser" type="parameter" >
102 <value type="constant" result="Unknown" />
103 </assignment>
104 </mapping>
105 </mappings>
106 </event-translation-spec>
107 <event-translation-spec uei="uei.opennms.org/vendor/Juniper/traps/jnxCmCfgChange" >
108 <mappings>
109 <mapping>
110 <assignment name="uei" type="field" >
111 <value type="constant" result="uei.opennms.org/internal/translator/entityConfigChanged" />
112 </assignment>
113 <assignment name="configSource" type="parameter" >
114 <value type="parameter" name="~^\.1\.3\.6\.1\.4\.1\.2636\.3\.18\.1\.7\.1\.4\..*" matches=".*" result="${0}" />
115 </assignment>
116 <assignment name="configUser" type="parameter" >
117 <value type="parameter" name="~^\.1\.3\.6\.1\.4\.1\.2636\.3\.18\.1\.7\.1\.5\..*" matches=".*" result="${0}" />
118 </assignment>
119 </mapping>
120 </mappings>
121 </event-translation-spec>
122
123 <!-- VOLTHA translators to attach the nodeid value to an alarm -->
124 <event-translation-spec uei="uei.opennms.org/vendor/voltha/alarmRaised">
125 <mappings>
126 <mapping>
127 <assignment type="field" name="nodeid">
128 <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">
129 <value type="parameter" name="ResourceId" matches=".*" result="${0}"/>
130 <value type="parameter" name="ResourceId" matches=".*" result="${0}"/>
131 </value>
132 </assignment>
133 <assignment type="field" name="uei">
134 <value type="constant" result="uei.opennms.org/vendor/voltha/alarmRaisedCorrelated"/>
135 </assignment>
136 <assignment type="field" name="severity">
137 <value type="field" name="severity" matches=".*" result="${0}" />
138 </assignment>
139 </mapping>
140 </mappings>
141 </event-translation-spec>
142 <event-translation-spec uei="uei.opennms.org/vendor/voltha/alarmCleared">
143 <mappings>
144 <mapping>
145 <assignment type="field" name="nodeid">
146 <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">
147 <value type="parameter" name="ResourceId" matches=".*" result="${0}"/>
148 <value type="parameter" name="ResourceId" matches=".*" result="${0}"/>
149 </value>
150 </assignment>
151 <assignment type="field" name="uei">
152 <value type="constant" result="uei.opennms.org/vendor/voltha/alarmClearedCorrelated"/>
153 </assignment>
154 <assignment type="field" name="severity">
155 <value type="field" name="severity" matches=".*" result="${0}" />
156 </assignment>
157 </mapping>
158 </mappings>
159 </event-translation-spec>
160
161 </translation>
162
163</event-translator-configuration>