Update incoming trap community string to a UserDefined field
search cancel

Update incoming trap community string to a UserDefined field

book

Article ID: 400198

calendar_today

Updated On:

Products

VMware Smart Assurance

Issue/Introduction

This article explains the use-case of updating the community string of an incoming trap, to one of the UserDefined fields on the Notifications.

Environment

Smarts 10.1.X

Resolution

  • Stop the Trap Adapter (TA) to introduce the following changes.
sm_service stop <Trap Adapter Service Name>
  • Start the trap adapter with the "--community" option to stream community string to the trap parser. 
    Example commandline of the service as follows:
sm_service install --force  --unmanaged  --startmode=manual \
'--name=<Trap Adapter>' \
 '--description=Smarts SNMP Trap Adapter' \
'/opt/SAM/smarts/bin/sm_trapd' \
'--name=<Trap Adapter>' \
'--server=<OI Domain>' \
 '--config=icoi' \
 '--port=162' \
 '--model=sm_actions' \
 '--community' \
 '--rules=icoi-trapd/trap_mgr_parse.asl' \
 '--seed=seedfile' \
'--output=<Trap Adapter>.log'
  • Edit the trap definition under : /conf/icoi/trap_mgr.conf as follows:
sm_edit ../conf/icoi/trap_mgr.conf
  • Update the UDF parameter to use the community string as follows:
UserDefined1: Community string: $C$

Note: Here $C$ is a variable substitution for the Community string of the trap that we are assigning to the UserDefined1 field. 

  • Restart the Trap Adapter (TA) for the settings to take effect.
sm_service start <Trap Adapter Service Name>