AnsweredAssumed Answered

time_origin not consistent in lua auto-operator script

Question asked by rrustong.1 on Aug 18, 2015
Latest reply on Aug 19, 2015 by rrustong.1

I am attempting to set several pieces of information in the custom fields of alarms and am having a difficult time getting the time_origin to work reliably.  Unfortunately I need to put the origin time in one of the custom fields as that is the only way for me to pass the origin time through the automated ticket creation probe (restsd_gtw) unless I want it as an epoch time.  I have been able to set several other values in the custom fields, but the origin time is not working.


This is the portion of the script that should be adding the origin time:

local al = alarm.get() local update = ()  update.nimid = al.nimid  update.custom_1 = al.time_origin  alarm.set(update)


If I run a similar script that just prints the values to the console, it always prints the time_origin properly.  The difference being that I am running the script manually and setting an alarmid that already exists instead of the auto-operator picking up the alarm on arrival.


I am calling the script from an auto-operator  profile that is configured as follows:

  • Action type: script
  • Action mode: On message arrival
  • Severity Level: all except green
  • Message Counter: Equals to 1


I need to have these custom_* values set as early as possible, as this is the groundwork necessary to start automating ticket creation upon alarm arrival.  I suspect that the time_origin field is not set immediately and my script is firing before it is set.  Is there a better way for me to get the origin time inserted to the custom_1 field?  Or is there a better profile configuration that I should be using to fire off my script?