I'm trying to create an auto-profile in NAS, that triggers on a specific alarm if the alarm is assigned to a user, which is created under an account in USM/UMP.The problem here is that you can't see the users from USM in NAS.
Is there any workaround here? I've before tried to change the user directly in the NAS.cfg. But that really messed things up later when I tried to do changes on the same profile again from the NAS-gui.
If you look at using just AO's to find the assignment event rather than adding triggers into the mix,
I would go with an AO set to run on "Message assigned to" with "<any>" as the condition, have the "Action Type" as "Script", Action Mode as "On Overdue Age" of 5 seconds (i ran into some issues testing with "on arrival"...seemed like it wanted a few seconds to digest the change, but that could be me). See below sample:
The script can then do all you need in terms of evaluating the alarm (as Marco_Ippati indicated), setting anything you have for the emailgtw, etc. I assume the code you have now sets all those correctly as you outlined in your first post?
Just a thought.
You might be able to do that using a LUA script as below:
a = alarm.get()
if a.assigned_to == "<AccountA/UserA>"
nimbus.alarm ( SeverityLevel, MessageText [, SuppressionKey [, SubsystemId [, Source]]] )
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:
if a.assigned_to == "test/test1"
pds.putString(myArgs,"value", "email@example.com, firstname.lastname@example.org")
response, retcode = nimbus.request("/Enterprise/nimsoft/hubnim1", "probe_config_set", myArgs)
local resp,rc = nimbus.request ("/Enterprise/nimsoft/hubnim1/emailgtw", "_restart")
print (retcode," ", response)
if a.assigned_to == "test/test2"
pds.putString(myArgs,"value", "email@example.com, firstname.lastname@example.org")
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.
Thx for your reply, Marco!
I'm not sure that will work in my case, but I hope I'm wrong.?
What I'm trying to create is that you should be able to assign the alarm to a user. After that I have a trigger that detects when this alarm is assigned. When the trigger is activated, then an auto-profile run a script, this script needs to know who the assigned user is, and then change an e-mail address on a profile in the emailgtw-probe, to the assigned user's e-mail adress.
I've tried to use a variant of your script. But it I don't get it to work :/
Does the trigger bring back the information in the alarm to the auto-profile?
Hi rith, Thanks for sharing your solution!