bulk delete alarms from specific probe and robot using Lua script
search cancel

bulk delete alarms from specific probe and robot using Lua script

book

Article ID: 389104

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM)

Issue/Introduction

We have a large flood of alarms from a particular probe and we need to delete these alarms quickly.

Deleting thousands of alarms from the GUI is tedious.  Can we script or automate the deletion?

Environment

DX UIM - Any Version

Resolution

The following is a Lua script which can be run inside the NAS Scripting GUI to quickly close/delete all alarms from a specific probe and robot.

This script is provided AS-IS and Broadcom Support is unable to assist with modifying or troubleshooting it.

You will need to modify the first two lines to give the appropriate robot name and probe name which have generated the alarms to delete.

 

robot_to_delete = 'robot_name'
probe_to_delete = 'probe_name'

alarmlist = alarm.list()
for k,v in pairs(alarmlist) do
print(alarmlist[k].prid)
  if alarmlist[k].robot == robot_to_delete then
   if alarmlist[k].prid ==  probe_to_delete then
    action.close(alarmlist[k]["nimid"])
   end
   end
end