I need to extract a single bit from an SNMP trap, which reports the state of eight digital sensors. The OIDs of the sensors are:
".1.3.6.1.4.1.42505.1.2.1.1.7.x"
where x can be 0 to 7.
The hex dump of the UDP packets that contain the traps is as follows:
30 3E 02 01 00 04 03 69 70 73 A4 34 06 09 2B 06 01 04 01 82 CC 09 01 40 04 0A 0A 0B 66 02 01 06 02 01 01 43 04 00 01 27 63 30 15 30 13 06 0E 2B 06 01 04 01 82 CC 09 01 02 01 01 07 01 02 01 00
Might somebody point me in the direction of how to parse these packets? I do not need a fully fledged trap parsing package, as that would be overkill. All I need is to parse the packets with PHP in order to extract the single relevant bit.
It seems you are asking for RFC 1157
But installing php-snmp would probably be easier.