On Mon, Jun 5, 2017 at 10:55 AM, Madhusudhana R <madhusudhan...@in.abb.com>
wrote:
> Hi Coders,
>
>
>
> My query is, does net-snmp support heterogeneous trap types?
>
> More precisely, is it possible to send traps with different data types
> like integer signed/unsigned/32bit/64bit , strings etc. during same
> execution
>
>
>
> Use case:
>
> For our convenience, we are reading the traps from a file which is
> converted to trap commands. Here I have defined say 12 traps for different
> data types.
>
> When trap values of different types are used to send, traps are not
> received on manager end.
>
> But trap values of same types are working fine.
>
>
>
> Please let me know whether heterogeneous trap types are allowed in SNMP
> architecture or not.
>
Yes. Here's an example:
sending:
snmptrap -v 2c -c trappy localhost:9162 42 IF-MIB::linkUp ifIndex.42 i 42
ifDescr.42 s 'My Awesome Interface' enterprises.6316.1.42 c 99
enterprises.6316.2.42 3 4242 enterprises.6316.3.42 C 1234567890
snmptrapd output:
2017-06-05 09:21:44 localhost.localdomain [UDP:
[127.0.0.1]:56631->[127.0.0.1]:9162]:
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (42) 0:00:00.42
SNMPv2-MIB::snmpTrapOID.0 = OID: IF-MIB::linkUp IF-MIB::ifIndex.42 =
INTEGER: 42 IF-MIB::ifDescr.42 = STRING: My Awesome Interface
SNMPv2-SMI::enterprises.6316.1.42 = Counter32: 99
SNMPv2-SMI::enterprises.6316.2.42 = 4242 SNMPv2-SMI::enterprises.6316.3.42
= Counter64: 1234567890
This single trap PDU contains INTEGER, String, Counter32, Integer32, and
Counter64 types in one trap. I believe that is what you mean when you say
"trap values of different types".
Bill
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders