Smarts SAM: What is the role of ElementClassName in the trap definition? How to generate Device Name and Device IP in the Notification via Trap?
search cancel

Smarts SAM: What is the role of ElementClassName in the trap definition? How to generate Device Name and Device IP in the Notification via Trap?

book

Article ID: 332098

calendar_today

Updated On:

Products

VMware Smart Assurance

Issue/Introduction

Symptoms:




What is the role of ElementClassName in the trap definition?
Which Parameters need to be checked in order to diagnose if a Trap appears in log but not the console.

Environment

VMware Smart Assurance - SMARTS

Cause

The Element of a given Smarts SAM Notification is set to the relationship that exists between the notification and the object it OccurredOn. The ElementClassName andElementName are computed over the related object. The ElementClassName and ElementClass are dependent on what you are importing from IP. 

The ElementClassName attributes should only be used when the UnknownAgent value in the trap_mgr.conf configuration file is set to CREATE. 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.