Suppress alarm from fetchmsg probe when there are multiple alarms

Document ID : KB000102733
Last Modified Date : 05/07/2018
Show Technical Document Details
Issue:
How do we suppress the lower severity alarm when a higher severity alarm is present?
UIM fetchmsg probe
Environment:
UIM 8.51
Resolution:
One option would be to edit the setup of the custom messages and remove the ‘$profile’ item from the message generated and change the suppression key to $host/$key.

A second option using a "nas" Auto Operator Profile and script.

1- Create a script with these contents
 -- Gets the ao-filtered alarm, this is passed by our profile
-- script provided as a sample and is not supported

a = alarm.get()
--get a sub string from the critical alarm - starting at position 0 to 26
messageSearchStr=(string.sub(a.message, 0,26))
-- set string for hostname from critical alarm hostname
criticalHost = a.hostname
--get a list of alarms and iterate through them
--alarm.list takes arguments as well, for key and value

al=alarm.list()
if al ~= nil then
   for i=1,#al do
      sevStr = "major"
      -- set string for major alarm hostname
      majorHost = al[i].hostname
      if (string.match(al[i].message , messageSearchStr) and string.match(al[i].severity, sevStr) and (majorHost == criticalHost)  ) then
            print("Hostname "..al[i].hostname)
            --create alarm to modify major alarm attributes
            e = {}
            e.nimid = al[i].nimid
            e.level = NIML_CLEAR                
            e.visible = 0
            alarm.set (e)
         end
   end
  --end
end

2- Create an Auto Operator profile.
      Action type:   script
      Action mode: On Message arrival
      Script: name of script created in step #1
      Probe: fetchmsg
Auto Operator Profile
Additional Information:
alarm.list ( [Field, Value [, Value…]] )
Returns an array of table elements containing alarm data. Will, if used with the field and value(s) parameters, filter the result set according to the user criteria. Use the column name for your field and one or more match strings. The % is used as the wildcard character. E.g alarm.list (“hostname”,”%xp%”) returns alarms for all hostnames with ’xp’ in them. These records are extracted from the NAS_ALARMS table.

*** Support cannot assist in writing and debugging LUA scripts ***