How to create and send a Test Trap to test Notify and Clear in Smarts Service Assurance Manager (Smarts SAM)
To create and send a test trap to test whether Smarts SAM is able to receive and clear trap notifications, the following tasks must be done:
- Create and add test trap definition to the Smarts SAM trap_mgr.conf configuration file.
- Turn on debug and logging in the Smarts SAM trap_mgr.conf configuration file.
- Save and close the trap_mgr.conf configuration file and restart the trap adapter.
- Send test trap
- Analyze trap notification processing in logs.
- Send trap clear.
- Analyze trap clear processing in logs.
The following explains each of these tasks in detail:
- Open the trap_mgr.conf configuration file for editing using sm_edit. This file will be found here:
<BASEDIR>/SAM/smarts/local/conf/icoi
IMPORTANT! You should always use sm_edit whenever you are editing Smarts configuration files (*.conf). Using other editors can cause issues with Smarts software functionality.
- Add the following trap definition to trap_mgr.conf configuration file:
# TEST traps
BEGIN_TRAP .1.3.6.1.4.1.2853 6 1
Category: OpsMgr.Event
ClassName: OpsMgr.$V1$
InstanceName: $V4$
EventName: $V3$
ElementName: $V4$
SysNameOrAddr: $V4$
Severity: $V2-sev$
EventText: $V7$
State: $V6-STATE$
EventType: DURABLE
ClearOnAcknowledge: FALSE
Expiration: 0
Map: {
V2-sev
0 = 5
1 = 3
2 = 1
}
{
V6-STATE
0 = NOTIFY
151 = NOTIFY
255 = CLEAR
}
ElementClassName: Host
UnknownAgent: IGNORE
LogFile: TEST-traps.log
END_TRAP
- Find the "Option Settings/Flags" section of the trap_mgr.conf configuration file.
- Turn on debug (DEBUG-TRUE) and logging (LOGGING=ALL) as shown in the following:
########################## Option Settings/Flags ##########################
# --------------------------------------------------------------------------
# This flag enables debug in the Trap Processor. With this flag set, verbose
# status messages will be generated, but the Trap Processor may have
# difficulty keeping up with a heavy Trap volume.
# --------------------------------------------------------------------------
DEBUG = TRUE
# --------------------------------------------------------------------------
# This flag enables logging in the Trap Processor. This flag takes four
# options: 'ALL', 'DISCARD', 'STATUS', and 'OFF'.
# o 'ALL' - All will log traps received, discarded, and server status.
# o 'DISCARD' - Discard will log discarded traps and server status.
# o 'STATUS' - Status will log server status changes.
# o 'OFF' - Off will produce only error logging.
# --------------------------------------------------------------------------
LOGGING = ALL
- When the changes to the trap_mgr.conf configuration file are complete, save and close the file.
- Restart the Smarts SAM trap adapter.
- Send Notify Trap. and observe Varbind 6 in test trap. To ensure Varbind 6 device is actually in the Smarts IP topology, you will need to modify Varbind 6 with your device name.
Notify Trap (Varbind 6 = 0 Notify, Mapped in definition V6-STATE 0 = NOTIFY)
./sm_snmp -d x.x.x.x -p 162 trap x.x.x.x .1.3.6.1.4.1.2853 6 1 0 .1.3.6.1.4.1.2349.2.2.2.1 s "AvailabilityHealth" .1.3.6.1.4.1.2349.2.2.2.2 i 2 .1.3.6.1.4.1.2349.2.2.2.3 s "Exchange 2007 Public Folder Database Alert" .1.3.6.1.4.1.2349.2.2.2.4 s "lwqun242.lss.emc.com" .1.3.6.1.4.1.2349.2.2.2.5 s "Public MDB" .1.3.6.1.4.1.2349.2.2.2.6 i 0 .1.3.6.1.4.1.2349.2.2.2.7 s "the Public Folder Database"
- Open the debug log in vi to analyze/debug the trap:
vi ../local/logs/sm_trapd_en_US_UTF-8.log
- Look to see if the trap was ignored if the device was not in the topology.
- Open the DAN813-OI.audit log in vi to look for Notify and Clear:
vi ../local/logs/DAN813-OI.audit
- Send Clear trap and observe Varbind 6:
Clear Trap (Varbind 6 = 255 Clear, Mapped in definition V6-STATE 255 = Clear)
./sm_snmp -d x.x.x.x -p 162 trap x.x.x.x .1.3.6.1.4.1.2853 6 1 0 .1.3.6.1.4.1.2349.2.2.2.1 s "AvailabilityHealth" .1.3.6.1.4.1.2349.2.2.2.2 i 2 .1.3.6.1.4.1.2349.2.2.2.3 s "Exchange 2007 Public Folder Database Alert" .1.3.6.1.4.1.2349.2.2.2.4 s "lwqun242.lss.emc.com" .1.3.6.1.4.1.2349.2.2.2.5 s "Public MDB" .1.3.6.1.4.1.2349.2.2.2.6 i 255 .1.3.6.1.4.1.2349.2.2.2.7 s "the Public Folder Database"