I have an old script that can be manipulated to send an alarm if there is no note attached, but is over a certain age old..
I'm after a script that will look to see if the alert is assigned to anyone and if not, send an email. Coupled with an AO profile I can then automate an escalation procedure.
I'd be very grateful if someone could take a look at the above script and amend it
Thanks in advance!
(Attaching script as attachment)
Think I have the beginning of this..
A working script!
a = alarm.get("CK46146697-15655")print(a.notes)--Is the alarm assigned?if a.assigned_to ~= nil thenassigned_to = trueelseassigned_to = falseendrequire ("library/html-alarms-lib")recipient = "email@example.com"title = "Non Acknowledged Alarm"msg = " Nimsoft alarm: "..a.messagemsg1 = " --- from "..a.hostnamebuf = ""buf = buf .. html_start (title)buf = buf .. html_alarm_message(msg)buf = buf .. html_alarm_message(msg1)buf = buf .. html_end ()print("Is this alarm assigned? ")if assigned_to == true then print("yes") else print("no") endarrival = a.arrival --Sets arrival as the alarm arrival time at the NAS b = timestamp.diff(arrival, "minutes") --Sets b as the difference in minutes between arrival and NOW (default)print("\n Difference between alarm arrival and now = "..b.." min")--if b (time from arrival till now) is more than 1hr and is not assigned then do something:if (b >= 60 and assigned_to == false) then action.email(recipient,title,buf) else print("This alert has been accepted")end