I haven't tested it yet, but you can try the attached script.
Here is a slightly revised version that tests to make sure the alarm.get() function actually returns an alarm into the alist variable.
Here is a variation of this alarm suppression script works great in our env due to the subsystems are setup. Doesn't use triggers or a preprocessing rule to make alarms invisble. It use 1 ao profile to run the script which then determines if the alarm should be set to invisible or not. The functions script contains a function to make a alarm invisible.The way it works is a aoprofile for the probe you want to make alarm invisible for on arrival. Alarm is check for any other alarms with that ip in this case our connection sid is 4.4.3 so if net_connect couldn't ping it then no use display a snmpget alarm saying it couldn't talk to it as well could very well be used agains int traffic as well.I have uploaded script as well since didn't no how it will display in formum.require ("tpi-scripts/functions")alist=alarm.get()if alist ~= nil then thisRobot = alist.robot thisAlarm = alist.nimid thisSource = alist.source al = alarm.list("hostname",thisSource) if al ~= nil then for i=1,#al do a=al host,assto,sid,robot,almessage = a.hostname,a.assigned_to,a.sid,a.robot,a.message printf ("their is a match moving to next step for ip %s - %s", a.sid,thisSource) if sid == "4.4.3" then printf ("their is a match setting to invisible - %s", thisSource) visible (thisAlarm) else printf ("no major connection alarm associated or not correct sid") end end else print "no match" endend
Can you please paste here the function ? Because i cannot seem to make it work.
Or at least, from where can i get the function ?
--This will contain commonly used funtions that can be called by any script.--Variables--database.open ('/opt/nimbus/probes/service/nas/transactionlog.db')--database.open ('/home/noc/hubs.db')--This funtion runs a system command and returns the output.function cmdout (cmd) local f = io.popen(cmd) local lout = f:read("*a") f:close() return loutend--This sets nimbus alarm to invisiblefunction visible(nid) action.visibility(false,nid)end