AnsweredAssumed Answered

LUA script to change severity from Critical to Minor

Question asked by bhupesh_walde on Sep 8, 2016
Latest reply on Sep 12, 2016 by Garin

Team,

 I am writing simple LUA script which will change the Severity from Critical to Minor.The script execute correctly for the first interval , In the next interval, it became again critical. This is specially for the "SNMP ageny is not responding"  of the interface_traffc probe. I am running script at every 1min interval. Please let me know what is the wrong into the script. 

--print "Change the snmp agent is not responding from Critical to Minor"

al = alarm.list("origin","Customer_Origin");

if al ~= nil then
for i=1,#al do
if (al[i].prid == 'interface_traffic') then
--printf("%02d %s %s %s %s %s",i,al[i].nimid,al[i].hostname,al[i].severity,al[i].message,al[i].prid)
a={}
a.nimid = al[i].nimid
a.severity = NIML_MINOR
a.prevlevel = al[i].level
alarm.set(a)
--printf("Change alarm - %s %s", a.nimid, a.severity)
end
end
end

 

Thanks for your support.

Outcomes