AnsweredAssumed Answered

LUA script clearing only 1000 alarms at a time

Question asked by amit_saxena on May 9, 2011
Latest reply on May 10, 2011 by amit_saxena

Hi all,

 

I am trying to remove all the alarms from nas (except from distsrv probe) through a trigger and custom LUA script.

 

Though both of them are working fine, however I am unable to remove more than 1000 alarms at a time which is a bit strange.

 

I am copy-pasting all the screenshots and LUA script below.

 

Please suggest and let me know where I am wrong.

 

Trigger Screenshot

 

 

 

 

 

Alarms count in the Trigger

 

 

 

 

 

 

LUA script

 

 

 

 

function ClearAlarmsExceptFromDistsrv (trigger_name)
   print "Inside function ClearAlarmsExceptFromDistsrv "

   message_ids=""

   alarms_set = trigger.alarms (trigger_name)
   for i,a in pairs(alarms_set) do
      printf ("%5d --> <<%s>>\n", i, a.nimid)
      message_ids = message_ids .. a.nimid .. ","
   end

   if message_ids ~= "" then
      action.close(message_ids)
   end

   print "Going to exit from function ClearAlarmsExceptFromDistsrv "
end

print "LUA script started...."

if trigger.state ("Alarms NOT from distsrv probe") then
   num_alarms = trigger.count ("Alarms NOT from distsrv probe")

   printf ("num_alarms = %d", num_alarms)

   ClearAlarmsExceptFromDistsrv ("Alarms NOT from distsrv probe")
end

 

 

 

 

 

 

LUA script output

 


----------- Executing script at 5/9/2011 5:52:54 PM ----------

  LUA script started....
  num_alarms = 31225
  Inside function ClearAlarmsExceptFromDistsrv
      1 --> <<CE90326524-01064>>

      2 --> <<CE90326524-01073>>

      3 --> <<CE90326524-01220>>

      4 --> <<CE90326524-01226>>

      5 --> <<CE90326524-02450>>

      6 --> <<CE90326524-02451>>

      7 --> <<CE90326524-02606>>

 

   991 --> <<QN30976957-97989>>

    992 --> <<QN30976957-98041>>

    993 --> <<QN30976957-98049>>

    994 --> <<QN30976957-98057>>

    995 --> <<QN30976957-98207>>

    996 --> <<QN30976957-99281>>

    997 --> <<QN30976957-99290>>

    998 --> <<QN30976957-99299>>

    999 --> <<QN30976957-99439>>

   1000 --> <<QN30976957-99447>>

  Going to exit from function ClearAlarmsExceptFromDistsrv
  LUA script completed....


 

NAS

 

 

 

 

 

 

I have disabled message suppression so as to get lots of alarms for testing.

 

Thanks & Regards,

Amit Saxena

Outcomes