Additional custom string message with snmptrap with different OID type
Using snmptrap I am able to send traps to a snmp adapter.
for example: Code:
snmptrap -v 1 -c public localhost HOST-RESOURCES-MIB::hrDeviceStatus.1 121.221.2.11 6 123 '' hrDeviceStatus.1 i 3 Code:
Mar 5 14:19:27 myxenvm snmptrapd[25808]: 2014-03-05 14:19:22 rnp00267366edc9.eu.tel.uss.com [121.221.2.11] (via UDP: [127.0.0.1]:35661) TRAP, SNMP v1, community public HOST-RESOURCES-MIB::hrDeviceStatus.1 Enterprise Specific Trap (123) Uptime: 5 days, 22:39:54.83 HOST-RESOURCES-MIB::hrDeviceStatus.1 = INTEGER: warning(3) 1. Can anyone let me understand why the uptime information is coming in the message ? 2. As the warning message is there, I need to send a custom message event to an adapter which will parse the output and do some further task. But as the OID type is INTEGER, I am not able to send any string type with the trap. How can I do it ?? |
Well looking at man snmptrap shows that for version 1, if the uptime is specified as empty (the '' after 123) then the host-uptime is used, so that's why you're uptime is coming through.
|
Quote:
Code:
snmptrap -v 1 -c public localhost HOST-RESOURCES-MIB::hrDeviceStatus.1 121.221.2.11 hrDeviceStatus.1 i 3 |
Quote:
At a glance you're missing: generic trap specific-trap uptime |
All times are GMT -5. The time now is 11:14 AM. |