This article explains the use-case of updating the community string of an incoming trap, to one of the UserDefined fields on the Notifications.
Smarts 10.1.X
sm_service stop <Trap Adapter Service Name>
--community" option to stream community string to the trap parser. 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'
sm_edit ../conf/icoi/trap_mgr.conf
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.
sm_service start <Trap Adapter Service Name>