Incorrect ElementName updated on the trap notificaitons when ForceOccurredOn = TRUE
search cancel

Incorrect ElementName updated on the trap notificaitons when ForceOccurredOn = TRUE

book

Article ID: 404062

calendar_today

Updated On:

Products

VMware Smart Assurance Network Observability

Issue/Introduction

This article explains an issue where incorrect element names are updated when ForceOccurredOn = TRUE i.e.,

  • Element Name, ElementClassName and ElementInstanceName are delivered via Trap ASL script or parameter similar to the below:
BEGIN_TRAP <OID> <GenericOID> <SpecificOID>      
ClassName: <ClassName>
InstanceName: <InstanceName>
    ForceOccurredOn: TRUE
ElementClassName: <UserSpecific ElementClassName>
ElementName: <UserSpecific ElementName>
EventName: <Event>
SysNameOrAddr: <UserSpecific System Name>
UnknownAgent: CREATE
    ForceOccurredOn: TRUE
.........<Any other custom parameters that are useful for traps>
END_TRAP

Note: When the ForceOccurredOn = TRUE, it is expected to add the ElementClass and ElementName fields to modify the OccuredOn relationship on the Notification.
# <force-occurred-on>          
Set this to 'TRUE', if you want to overwrite the ElementClass and ElementName which will modify the 'OccurredOn' Object.
Note: The object(ELEMENTCLASSNAME, ELEMENTNAME) should exist, otherwise the trap will default to having Agent's Name, if it exists in the topology.

Environment

All supported release of Smarts

Cause

The parameter: suppress_agent_as_occurredon = "TRUE" is not set when ForceOccurredOn is detected with valid ElementName and ElementClassName in the file: <Base-Dir>/smarts/rules/icoi-trapd/trap_mgr_parse.asl 

/* Check if HookScript is telling us change the sourceObj i.e OccurredOn Object
    ------------------------------------------------------------------------------- */
    if ( force_occurredon == "TRUE" ) {
         if ( elementclassname != "" && elementinstancename != "" ) {
            sourceObj = object(elementclassname, elementinstancename) ? IGNORE;
            if (debug) {
               print(printHeader."NOTIFY_EVENT : OccurredOn was set to '".elementclassname."::".elementinstancename."'.");
            }
         }
         else if (debug) {
            print(printHeader."NOTIFY_EVENT : OccurredOn cannot be changed, ElementClassName and/or ElementInstanceName were not set.");
         }
    }

    /* Check if instructed to skip setting Agent as OccurredOn
    ------------------------------------------------------------------------------- */
    if ( suppress_agent_as_occurredon == "TRUE" ) {

        if (debug) {
               print(printHeader."NOTIFY_EVENT : supressing setting of Agent as OccurredOn");
        }
    }

Resolution

In an ideal scenario, the suppress_agent_as_occurredon = "TRUE" needs to be set if the  force_occurredon =TRUE and (Elementclassname != "" && Elementinstancename != "")
Hence, add the highlighted parameter to this section and save the file.

    /* Check if HookScript is telling us change the sourceObj i.e OccurredOn Object
    ------------------------------------------------------------------------------- */
    if ( force_occurredon == "TRUE" ) {
         if ( elementclassname != "" && elementinstancename != "" ) {
            sourceObj = object(elementclassname, elementinstancename) ? IGNORE;
          suppress_agent_as_occurredon = "TRUE";
            if (debug) {
             print(printHeader."NOTIFY_EVENT : OccurredOn was set to '".elementclassname."::".elementinstancename."'.");
            }
         }
         else if (debug) {
            print(printHeader."NOTIFY_EVENT : OccurredOn cannot be changed, ElementClassName and/or ElementInstanceName were not set.");
         }
    }

    /* Check if instructed to skip setting Agent as OccurredOn
    ------------------------------------------------------------------------------- */
    if ( suppress_agent_as_occurredon == "TRUE" ) {

        if (debug) {
               print(printHeader."NOTIFY_EVENT : supressing setting of Agent as OccurredOn");
        }
    }
    else {
..... further processing to lookup for Agent and ElementName/ElementClassName mapping based on OI topology