I had a look at the script and I have a few questions and remarks.
-- What is the purpose of the script and what is the result?
-- Attributes which are needed in the work function shall be used in the query string (if possible). Then there is no need to do a dpGet() in the work function.
-- If a dpGet() is called in a work function the result is probably not "correct"
E.g. if the alert state changes between calling the work function and doing a dpGet() the values read by dpGet() do not fit the values received in the hotlink
-- Instead of single dpGet() calls one dpGet() with all attributes shall be made
-- The result of reading the attribute _online.._stime is not used in the script
-- It is the same for the result of doing a dpGet() for _alert_hdl.._num_ranges, _alert_hdl."+PriorRange+"._prior", _alert_hdl.._direction
-- The last characters in the query string +"" are not needed
Best Regards
Leopold Knipp
Senior Support Specialist
* You have a for-next loop with a variable 'i'. Inside this loop you again use an 'int i'. When you decide to nest a for-next lop then at least use a different character
* You count the alarms by going through a global mapping 'i