rpunt

attempt to index global 'alarm' (a nil value)

Discussion created by rpunt on Jul 20, 2010
Latest reply on Jul 21, 2010 by keith_k

Trying to write a pre-processing rule in AO, but can't seem to access any alarm details. Given script:

 

 

a = alarm.get()
if a ~= nil and a.severity ~= "information" then
   new_alarm = {}
   new_alarm.host,new_alarm.message,new_alarm.nimid,new_alarm.supp_key,new_alarm.subsys = a.hostname,a.message,a.nimid,a.supp_key,a.subsys
   if a.level >= 1 then
      new_alarm.level = NIML_INFORMATION
   else
      new_alarm.level = NIML_CLEAR      
   end
   alarm.set(new_alarm)
end

 

I get this error in the NAS log:

 

Jul 20 09:27:43:656 [0664] nas: OVERRIDE BY RULE 'Make Progress IO errors informational' - msg:vv_flush: I/O error ,src:qadmfg,sev:3

Jul 20 09:27:43:656 [0664] nas: PREPROCESSOR ERROR: scripts/test-informational:1: attempt to index global 'alarm' (a nil value)

 

Is there a library I need to include? Something else to declare? I'm sure I'm missing something painfully obvious...

Outcomes