The following example shows how to set Severity based on varbind 1 using the Smarts SAM trap adapter. This is done in the trap_mgr.conf file found here:
<BASEDIR>/smarts/local/conf/icoi/trap_mgr.conf
Example
In the following example, Severity will be set to 1,2 or 3 based on Varbind 1 value of AT,WR or IN.
IMPORTANT! Be sure to leave a space between the "=" and the values in the Map configuration settings, or a "Bad entry in trap_mgr.conf" error will be logged in the trap adapter log. To prevent the "Bad entry" error, the setting in the Map configuration in the following example must be AT = 1 and not AT=1.
BEGIN_TRAP * 1 *
ClassName: Host
InstanceName: $SYS$
EventName: $V*$
Severity: $V1-severity$
UnknownAgent: CREATE
State: NOTIFY
EventType: MOMENTARY
Expiration: 360
EventText: $V1$
Map: {
V1-severity
AT = 1
WR = 2
IN = 3
}
END_TRAP