encoding - Parsing SNMP responses with PHP -
i'm reading out several properties on our switches on snmp php. i'm looking @ making resulting output of snmpget , snmpwalk usefull consumers of our api's.
problem responses this: integer: up(1) , integer: 10103 ...
is there convention/standard on how parse response format or response vendor specific each device trying read?
is there chance php library, function or extension can cast these responses in php native variables or @ least usefull can work with?
update:
i've found out few new things namely there indeed several libraries in php can parse binary asn.1 strings ber encoded strings if i'm right. problem can't seem find way binary data devices php ...
i'm not sure particular php methods, difference between 2 integer examples whether system has snmp mib corresponding oid (e.g. determine 1 means "up").
if want integers, should able pass parameter or walk command. example, net-snmp's snmpget or snmpwalk commands take -oe remove symbolic labels. manpage:
$ snmpget -c public -v 1 localhost ipforwarding.0 ip-mib::ipforwarding.0 = integer: forwarding(1) $ snmpget -c public -v 1 -oe localhost ipforwarding.0 ip-mib::ipforwarding.0 = integer: 1 if parsing net-snmp output, recommend reading snmpcmd man page has lot of output options interest display of other types such timeticks , strings.
if want retrieve snmp in php @ how cacti it.
Comments
Post a Comment