Role of ElementClassName in the trap definition
search cancel

Role of ElementClassName in the trap definition

book

Article ID: 332098

calendar_today

Updated On:

Products

VMware Smart Assurance VMware Telco Cloud Service Assurance

Issue/Introduction

Symptoms:

  1. What is the role of ElementClassName in the trap definition?
  2. Which Parameters need to be checked in order to diagnose if a Trap appears in log but not the console.
  3. How to generate Device Name and Device IP in the Notification via Trap?

Environment

SMARTS - 10.1.x

SMARTS DM - 2.X

TCSA - 2.X

Cause

  1. The Element of a given Smarts SAM Notification is set to the relationship that exists between the notification and the object it OccurredOn.
  2. The ElementClassName andElementName are computed over the related object.
  3. The ElementClassName and ElementClass are dependent on what you are importing from IP.
  4. The ElementClassName attributes should only be used when the UnknownAgent value in the trap_mgr.conf configuration file is set to CREATE.
  5. Also, when these attributes are used, the ElementClassName must be a class of UnitaryComputerSystem.
  • The trap_mgr.conf configuration file is found here:

    <BASEDIR>/SAM/smarts/local/conf/icoi/trap_mgr.conf

    This issue occurs when ElementClassName attribute is not part of the trap definition.

 

  • For example please refer the below custom trap definition :

    # Custom Trap
    BEGIN_TRAP .1.22.333 * *
            ElementName:    $V2-ServerName$
            SysNameOrAddr:  $V2-IP$
            SuppressAgentAsOccurredOn: TRUE
            EventName:      $V3$
            InstanceName:   $V2$ $V6$
            ClassName:      Hyperic
            ClearOnAcknowledge:     FALSE
            LogFile:        Hyperic.log
            UserDefined1:   $V1$
            UserDefined2:   $V4$
            UserDefined3:   $V6$
            UserDefined4:   $V2-ServerName$
            Severity:       $V5-Sev$
    #       Name:           $V6$
            Expiration:     600
            # Change severities
            # Local element name mapping.
            Map:{
            V5-Sev
            1=3
            2=2
            3=1
            }
            {
            V2-ServerName
            
            }
            {
            V2-IP

             
    END_TRAP

Resolution

Adding ElementClassName to the custom trap, helps SMARTS identify the type of Device and propagate the trap details to the Notification Log Console.

Below is the correct trap definition to achieve the same :

# Custom Trap
BEGIN_TRAP .1.22.333 * *
        ElementName:    $V2-ServerName$
        SysNameOrAddr:  $V2-IP$
        SuppressAgentAsOccurredOn: TRUE
        EventName:      $V3$
        ElementClassName :  Host
        InstanceName:   $V2$ $V6$
        ClassName:      Hyperic
        ClearOnAcknowledge:     FALSE
        LogFile:        Hyperic.log
        UserDefined1:   $V1$
        UserDefined2:   $V4$
        UserDefined3:   $V6$
        UserDefined4:   $V2-ServerName$
        Severity:       $V5-Sev$
#       Name:           $V6$
        Expiration:     600
        # Change severities
        # Local element name mapping.
        Map:{
        V5-Sev
        1=3
        2=2
        3=1
        }
        {
        V2-ServerName
   
        }
        {
        V2-IP

          }
END_TRAP

The above trap definition is an example on how to map Device Name and Device IP to the device.