Details
Assignee
UnassignedUnassignedReporter
DominikDominikLabels
Components
Affects versions
Priority
Major
Details
Details
Assignee
Unassigned
UnassignedReporter
Dominik
DominikLabels
Components
Affects versions
Priority
PagerDuty
PagerDuty
PagerDuty
Created July 13, 2010 at 7:40 AM
Updated September 21, 2021 at 6:24 PM
I tried to setup a translation today and while debugging my config, I used an sql pg_sleep statement.
While looking at the logs (see timestamps in the log.txt attachment), I found that, apparently, each statement is run 3 times. (actually n*2+1 since with two mappings, each using one sleep, sleep is run 5 times).
If this is not absolutely necessary, maybe it can be optimized to only run once to improve performance.
translator config:
<event-translation-spec uei="uei.opennms.org/mib2events/q3AlarmCleared">
<mappings>
<mapping>
<assignment name="uei" type="field" >
<value type="constant" result="uei.opennms.org/translator/q3AlarmCleared" />
</assignment>
<assignment name="sleep" type="parameter">
<value type="sql" result="select pg_sleep(30)" />
</assignment>
<assignment name="egal" type="parameter">
<value type="sql" result="select getunackdq3alarms()" />
</assignment>
<assignment name="ackdauer" type="parameter">
<value type="sql" result="select ackdauer from (select respondtime-pagetime ackdauer from notifications where notifyid=(select notifyid from notifications where eventid=(SELECT eventid FROM events WHERE eventparms ~ ? and eventuei ='uei.opennms.org/mib2events/q3Alarm'))) ackdauer where ackdauer < '5 minutes'" >
<value type="parameter" name="~^\.1\.3\.6\.1\.4\.1\.231\.7\.1\.3\.1\.1\.1\.3\.0$" matches=".*" result="${0}" />
</value>
</assignment>
</mapping>
</mappings>
</event-translation-spec>