same threshold on multiple dci
-
-
Solved my problem with script, though i have one problem i can't seem to figure out
28 DCI with name starting with IntQ that collects data every 5 sec
1 DCI that runs the script every minuteWhat this script does is that it will trigger event and set alarm if any of the DCI values do not go down under 15 min (900sec)
and if values goes down and alarm exists trigger event to terminate alarmMAIL_ALL event has create alarm with key ALARM-%1
MAIL_ALL_RESET event has terminate alarm with key ALARM-%1The logic works it will trigger the events and create alarm correctly but the termination of the alarm in MAIL_ALL_RESET does not work and the alarm will remain, i can not see why this should not work.
Any help in this would be very appreciated.
foreach(adci : FindAllDCIs($node,"IntQ*")) { eventtrigger = 1; oldval=0; // Check DCI values if they are going down within time period. foreach(dcivalue : GetDCIValues($node, adci->id, time() - 900, time())) { if((oldval > dcivalue) || (dcivalue == 0)){eventtrigger = 0;} oldval = dcivalue; } alarm = FindAlarmByKey("ALARM-".adci->name); // Trigger event, and set alarm so mail action is only triggered once. if(eventtrigger == 1) { if(alarm == null) { PostEvent($node, "MAIL_ALL", null, adci->name, adci->description, null, GetDCIValue($node, adci->id)); } } // Reset event alarm if(eventtrigger == 0) { if(alarm != null) { PostEvent($node, "MAIL_ALL_RESET", adci->name, adci->description, null, GetDCIValue($node, adci->id)); } } }Edit: Even tried terminating alarm via method terminate still nothing.
-
Hi,
in second PostEvent you pass DCI name as tag, not as first event parameter. You have to insert null there (as in first PostEvent call).
Best regards,
Victor -
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login