This API allows the user to create SNMP Trap Listener.
SNMP v1 Trap:
https://[HOST]:[PORT]/AppManager/xml/AddTrapListener?apikey=[API KEY]&trapName=[TRAP NAME]&trapStatus=[TRAP STATUS]&trapVersion=v1&trapType=[GENERIC TYPE]&specificType=[SPECIFIC TYPE]&enterpriseOID=[ENTERPRISE OID]&severity=[SEVERITY]&filterCondition=[FILTER VARBINDS]&trapCustomVarbinds=[CUSTOMIZE MESSAGE]&associateTrapSeverity=[ASSOCIATE TRAP SEVERITY]&trapHost=[RECEIVE TRAP]&monitorGroups=[MONITOR GROUPS]
SNMP v2 Trap:
https://[HOST]:[PORT]/AppManager/xml/AddTrapListener?apikey=[API KEY]&trapName=[TRAP NAME]&trapStatus=[TRAP STATUS]&trapVersion=v2&trapOID=[TRAP OID]&severity=[SEVERITY]&filterCondition=[FILTER VARBINDS]&trapCustomVarbinds=[CUSTOMIZE MESSAGE]&associateTrapSeverity=[ASSOCIATE TRAP SEVERITY]&trapHost=[RECEIVE TRAP]&monitorGroups=[MONITOR GROUPS]
SNMP v3 Trap:
https://[HOST]:[PORT]/AppManager/xml/AddTrapListener?apikey=[API KEY]&trapName=[TRAP NAME]&trapStatus=[TRAP STATUS]&trapVersion=v3&trapOID=[TRAP OID]&v3UserName=[V3 USERNAME]&severity=[SEVERITY]&filterCondition=[FILTER VARBINDS]&trapCustomVarbinds=[CUSTOMIZE MESSAGE]&associateTrapSeverity=[ASSOCIATE TRAP SEVERITY]&trapHost=[RECEIVE TRAP]&monitorGroups=[MONITOR GROUPS]
Supported HTTP methods: POST
Allowed roles: Administrator
The parameters involved in the API request are described below. Also, refer to the list of common request parameters. To know more about the HTTP error codes, refer here.
Field | Description | Comments | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
API Key | The key generated from "Generate API Key" option in the Settings tab. | |||||||||
trapName | Name of the SNMP trap listener. | |||||||||
trapStatus | Status of the trap listener. (enable or disable) | |||||||||
trapVersion | Version of the SNMP trap listener. (v1, v2, or v3) | |||||||||
trapType | The generic type of the trap. Possible values are:
|
Optional (Mandatory for version v1) | ||||||||
specificType | The specific type of the trap (for enterpriseSpecific traps (i.e.) for trapType=6). |
|
||||||||
enterpriseOID | Enterprise Object ID (OID) of the v1 trap. | Optional (Mandatory for version v1) | ||||||||
trapOID | Object ID (OID) of the v2/v3 trap. | Optional (Mandatory for versions v2 and v3) | ||||||||
v3UserName | The username of the v3 trap. | Optional (Mandatory for version v3) | ||||||||
filterCondition | The condition to filter traps based on variable bindings. (AND / OR) | Optional | ||||||||
filterText | The variable binding condition to filter the traps. Condition should be specified in JSON array format as:
{"varId":"[VAR ID]","varCondition":"[VAR CONDITION]","varValue":"[VAR VALUE]"}
|
Optional | ||||||||
trapCustomVarbinds | Message to customise the trap message (Varbinds). Possible values are:
|
Optional | ||||||||
associateTrapSeverity | Associates trap severity on server health. (true or false) By default, value is false. | Optional | ||||||||
trapHost | The host of the trap, if you want to receive traps from only this host. | Optional | ||||||||
monitorGroups | The IDs of the monitor groups you want to map the trap listener to. | Optional | ||||||||
severity | The severity of the trap listener when the trap is received. Possible values are either critical, warning, clear, or varbindbased. | If the severity has to be configured based on variable bindings, then provide "varbindbased" as the value. | ||||||||
criticalCondition, warningCondition, clearCondition | The condition by which the thresholds should be evaluated for Critical/Warning/Clear severity. Possible values are either AND, OR, or WHOLE. |
|
||||||||
criticalThreshold, warningThreshold, clearThreshold | The variable binding threshold conditions to determine Critical/Warning/Clear severity. Threshold condition should be specified in JSON array format as:
{"varId":"[VAR ID]","varCondition":"[VAR CONDITION]","varValue":"[VAR VALUE]"}
|
Optional ('criticalThreshold' field is mandatory if severity is varbindbased) | ||||||||
criticalActions, warningActions, clearActions | The action ID(s) of the actions you want to configure if the severity is Critical/Warning/Clear. | Optional |
Note: Only upto 20 conditions are accepted. If the number of conditions are more than 20, it is treated as invalid.
SNMP v1 Trap:
https://apm-prod-server:8443/AppManager/xml/AddTrapListener?apikey=aaaaaabbbbbbccccccddddddeeeeee&trapStatus=enable&trapVersion=v1&severity=critical&trapType=6&specificType=2&enterpriseOID=.1.2.3.4&trapName=trap1OID&associateTrapSeverity=true
SNMP v2 Trap:
https://apm-prod-server:8443/AppManager/xml/AddTrapListener?apikey=aaaaaabbbbbbccccccddddddeeeeee&trapStatus=enable&trapVersion=v2&severity=critical&trapOID=.0.1.2.3.4&trapName=trap2
SNMP v3 Trap:
https://apm-prod-server:8443/AppManager/xml/AddTrapListener?apikey=aaaaaabbbbbbccccccddddddeeeeee&trapStatus=enable&trapVersion=v3&severity=clear&trapOID=.0.1.2.3.4&trapName=trap3&v3UserName=mithun
With varbind filters and varbind-based severity:
https://apm-prod-server:8443/AppManager/xml/AddTrapListener?apikey=aaaaaabbbbbbccccccddddddeeeeee&trapStatus=enable&filterCondition=OR&filterText={"varId":"1","varCondition":"CT","varValue":"critical"},{"varId":"3","varCondition":"SW","varValue":"hi"}&trapVersion=v1&severity=varbindbased&criticalCondition=AND&criticalThreshold={"varId":"1","varCondition":"CT","varValue":"critical"}&trapType=6&specificType=2&enterpriseOID=.1.2.3.4&trapName=trap1OID&associateTrapSeverity=true
With actions and monitor groups:
https://apm-prod-server:8443/AppManager/xml/AddTrapListener?apikey=aaaaaabbbbbbccccccddddddeeeeee&trapStatus=enable&trapVersion=v1&severity=varbindbased&criticalCondition=AND&criticalThreshold={"varId":"1","varCondition":"CT","varValue":"critical"}&warningCondition=AND&warningThreshold={"varId":"1","varCondition":"CT","varValue":"critical"}&clearCondition=AND&clearThreshold={"varId":"1","varCondition":"CT","varValue":"critical"}&trapType=6&specificType=2&enterpriseOID=.1.2.3.4&trapName=trap1OID&associateTrapSeverity=true&warningActions=10000003,10000004,10000005&monitorGroups=10000013,100000134