Relate Alert Executable Attributes to table "alarm_t"

APM 9.51

I am using (or would to use) an alert executable to invoke the "GdeOpenApi" and read alert information from the "alarm_t" table. The challenge is finding a value from the available alert executable attributes to key on the "alarm_t" table. Does anyone have a suggestion?

 

Thank You

 

Link to alarm_t

Link to EUM Alert Attributes 

  • Hi CJW66,

    the list of parameters / variables you can use when creating an EUM event alert and an executing an executable as alert action is documented, as you found yourself.
    The problem is that the alert - when triggered - doesn't carry any id you could use to retrieve the entry written to ALARMS (that's the profile db table which corresponds to alarm_t),
    The key one would is us "AL_ALARM_ID"

    SELECT [AL_TIMESTAMP],[AL_ALARM_ID] FROM [APM1086_PROFDEF].[dbo].[ALARMS_10000]

    AL_TIMESTAMP AL_ALARM_ID
    2021-03-01 10:06:18.000 1
    ..
    2021-03-01 10:26:18.000 7

    however this data is not available in the EUM alert definition.

    You can somehow "guesstimeate" the entry by using the timestamp which is available as
    <<Alert Trigger Time UTC>>,
    and retrieve the entry from ALARMS where the timestamp matches.
    If you have many alerts, it might retrieve too many or incorrect entries, of course, as the time is not a unique key, so you might filter further.

    I created an alert with this alert action
    execute
      c:\temp\sg.bat "<<Alert Name>>" "<<Alert Trigger Time UTC>>" "<<Entity ID>>"
    the script simply writes the variable content into a file, there I can find

    parm1 : "SG_Alert_Test"
    parm2 : "Mon Mar 01 11:11:16 AM 2021 [Central European Time] [ 0100]"
    parm3 : "456e1eaba42c4d1d96bac0b123a4c11e"

    The ALARMS table show

    SELECT [AL_TIMESTAMP],[AL_ALARM_ID],[AL_TRIGGERED_TIME],[AL_ALARM_NAME],[AL_ENTITY_ID]
    FROM [APM1086_PROFDEF].[dbo].[ALARMS_10000]

    AL_TIMESTAMP AL_ALARM_ID AL_TRIGGERED_TIME AL_ALARM_NAME AL_ENTITY_ID
    ..
    2021-03-01 11:11:16.000 21 2021-03-01 11:12:49.000 SG_Alert_Test 0x456E1EABA42C4D1D96BAC0B123A4C11E
    ..

    So if you manage to buikd a GdeOpenAPI request using the time, the alert name and the entity id, you should get to what you need.

    Greetings
    Siggi

  • Hi Siggi

    Thanks for the response. I think we are barking up the same tree. I was really hoping to find a common parameter. Instead I have settled on passing the <<Alert XML>> parameter and parsing through the XML. Based on what I am doing this will be suffice and reduces the number of calls to the GdeOpenAPI to zero.

    Thanks Again!