Guys, thank you! It worked! No need for the trigger
I used "on overdue age = 1 min", and it works perfectly.
Script then looks like this:
a = alarm.get()
if a.assigned_to == "test/test1"
then
myArgs=pds.create()
pds.putString(myArgs,"name", "emailgtw")
pds.putString(myArgs,"section", "/profiles/RESURSTEKNIK")
pds.putString(myArgs,"key", "email")
pds.putString(myArgs,"value", "email@test.se, email2@test.se")
response, retcode = nimbus.request("/Enterprise/nimsoft/hubnim1", "probe_config_set", myArgs)
local resp,rc = nimbus.request ("/Enterprise/nimsoft/hubnim1/emailgtw", "_restart")
print (retcode," ", response)
end
if a.assigned_to == "test/test2"
then
then
myArgs=pds.create()
pds.putString(myArgs,"name", "emailgtw")
pds.putString(myArgs,"section", "/profiles/RESURSTEKNIK")
pds.putString(myArgs,"key", "email")
pds.putString(myArgs,"value", "email3@test.se, email4@test.se")
response, retcode = nimbus.request("/Enterprise/nimsoft/hubnim1", "probe_config_set", myArgs)
local resp,rc = nimbus.request ("/Enterprise/nimsoft/hubnim1/emailgtw", "_restart")
print (retcode," ", response)
end
end so on....
What I'm trying to create here is:
First I created a rawalarm, scheduled every day (or whenever) which say something like: "Assign this message to he who has the standby duty".
The one (or someone else) who has the "standby duty" will then assign this message to a specific account/user, and then this script will change the emailgtw-profile so that other important AO-profile will send mail/SMS to the correct person on duty.
It's also an easy way for our monitoring/operation-staff to see who's on duty, if they've switch days/weeks in the standby-schedule.
This might be useful for someone else.