xslim / php-snmp

sending SNMP v2c traps from directly PHP, without using any command-line utilites or modules. Just socket_open and socket_sendto
4 stars 2 forks source link

Issue with oid if the integer is greater than 16383 #6

Open divakar525 opened 7 years ago

divakar525 commented 7 years ago

When I have provided '1.3.6.1.4.1.28319.10.2.2' in oid then it is converted to '1.3.6.1.4.1.11935.10.2.2' while sending to the snmp trap.

Example variable:

$vars[] = packVarBind(array('oid' => '1.3.6.1.4.1.28319.10.2.2', 'value' => 'sample', 'type' => 'o' ));

While debugging, I found that if the value in oid is greater than 16384 then it is being reset from 0 so I am unable to receive the actual oid on the snmp trap.

So the oid value should be the same while sending from php and on receiving on snmp trap end.

Please let me know if I need to set any configuration while sending the snmp trap.