How to pass CPU Utilization and Threshold values to Alarm title for a CPU alarm in Spectrum
search cancel

How to pass CPU Utilization and Threshold values to Alarm title for a CPU alarm in Spectrum

book

Article ID: 48841

calendar_today

Updated On:

Products

CA Spectrum DX NetOps

Issue/Introduction

In Spectrum CPU and Memory alerts are generated based on Single instance or Aggregate instance depending on the EventDisp entries.

The alarm title says " High CPU Utilization " or "High Aggregate CPU Utilization". It doesn't reflect the Utilization and threshold values as reported in the event message.

This solution helps you to transfer the values to alarm title from the event message using an Event Procedure.

Environment

Release: Any
Component:

Resolution

Follow the steps outlined in this solution to achieve the above mentioned requirement

  1. The event code for High CPU utilization is 0x10f03. This is the event message.

    "High CPU Utilization. The utilization of {C 1}% for CPU instance {C 3} named {C 5} has exceeded the {C 0}% threshold on model {m} for more than the acceptable time period".

  2. The event variable 1 refers current utilization , 3 refers to CPU instance, 5 refers to CPU instance name and 0 represents the configured threshold.

  3. Now for event procedure to work create a new event with the same event message as default event.

  4. Remove the alarm from default event.

  5. Edit the EventDisp file in the custom directory like this:
    0x00010f03 P"\ ---------------> Default High CPU Utilization event 
    CreateEventWithVariables(\ 
    {C CURRENT_MODEL},\ 
    {H 0xfff0012d},\ ------------------> New event 
    SetEventVariable(\ 
    GetEventVariableList(),\ 
    {H 0x00012b4c},\ -----------------> Attribute id of Dynamic alarm title attribute 
    Append(\ {S\"High CPU Utilization : Threshold - Utilization:\"},\ --------> Message to appear in Alarm Title 
    Append(\ 
    Append(\ 
    Append(\ { S \"\" },\ 
    ToString(GetEventVariable ( { U 0 }))),\ ------------------> Getting the configured CPU threshold from event message. 
    {S \" ; \" }),\ 
    ToString( GetEventVariable({U 1}))))))" ------------------> Getting the Utilization CPU value from event message.
  6. Once done save the EventDisp file.

  7. Generate a High CPU alert which will trigger 0xfff0012d event with the below alarm title

    " High CPU Utilization : Threshold - Utilization:2:35"

NOTE: The 0xfff0012d is used in this example. You will need to create and use your own custom event.

NOTE: This Event procedure example can be used in other similar events.