DX Unified Infrastructure Management

  • 1.  LUA script to change severity from Critical to Minor

    Posted Sep 08, 2016 08:35 AM

    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.



  • 2.  Re: LUA script to change severity from Critical to Minor

    Broadcom Employee
    Posted Sep 08, 2016 09:22 AM

    This looks correct.

    When you run this what are you getting in your nas logs?

    ( would look at nas loglevel 3 logs with logsize set to 15000 logsize will need to be added via raw config)

     

    is it possible what you are seeing is an update coming in from the probe again?



  • 3.  Re: LUA script to change severity from Critical to Minor

    Broadcom Employee
    Posted Sep 08, 2016 10:24 AM

    You could set up a nas preprocessing rule to lower the severity of the SNMP agent alarms to minor using a short script.

     

    event.level = 3
    event.message = "The SNMP agent is not responding"
    return event

     

     

    I just tested this and it worked as expected on subsequent alarms over time.

     

    nas v4.73



  • 4.  Re: LUA script to change severity from Critical to Minor

    Posted Sep 12, 2016 08:04 AM

    You need to do this in a preprocessing script instead of an AO rule. Otherwise you will have the behavior that the alert comes in Critical. Then on the interval, your script changes the priority to minor. Then an update to the alert comes in and the priority goes back to critical. Then on the interval, your script changes the priority back to minor again. 

     

    -Gairn