Bug #74642 [Com]: snmprealwalk resets oid output format
| From: | php at mcq8 dot be | Date: | Sat, 10 Jun 2017 23:58:31 +0000 |
| Subject: | Bug #74642 [Com]: snmprealwalk resets oid output format | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-209469@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74642&edit=1
ID: 74642
Comment by: php at mcq8 dot be
Reported by: mattias dot wallin at salanet dot se
Summary: snmprealwalk resets oid output format
Status: Open
Type: Bug
Package: SNMP related
Operating System: Ubuntu 14.04 LTS
PHP Version: 7.0.19
Block user comment: N
Private report: N
New Comment:
Based on what you have in the expected result, you want to use snmp_set_enum_print(1) instead of
snmp_set_oid_output_format(SNMP_OID_OUTPUT_NUMERIC)?
The OIDs are in fact all numeric as expected in your example.
Previous Comments:
------------------------------------------------------------------------
[2017-05-24 10:00:20] mattias dot wallin at salanet dot se
Description:
------------
snmprealwalk with non numeric object_id resets oid output format for current call, and future calls.
Test script:
---------------
<?php
snmp_set_oid_output_format(SNMP_OID_OUTPUT_NUMERIC);
print_r(snmprealwalk('1.2.3.4', 'public',
'.1.3.6.1.2.1.17.2.15.1.3.1'));
print_r(snmprealwalk('1.2.3.4', 'public',
'BRIDGE-MIB::dot1dStpPortState.1'));
print_r(snmprealwalk('1.2.3.4', 'public',
'.1.3.6.1.2.1.17.2.15.1.3.1'));
?>
Expected result:
----------------
Array
(
[.1.3.6.1.2.1.17.2.15.1.3.1] => INTEGER: 5
)
Array
(
[.1.3.6.1.2.1.17.2.15.1.3.1] => INTEGER: 5
)
Array
(
[.1.3.6.1.2.1.17.2.15.1.3.1] => INTEGER: 5
)
Actual result:
--------------
Array
(
[.1.3.6.1.2.1.17.2.15.1.3.1] => INTEGER: 5
)
Array
(
[.1.3.6.1.2.1.17.2.15.1.3.1] => INTEGER: forwarding(5)
)
Array
(
[.1.3.6.1.2.1.17.2.15.1.3.1] => INTEGER: forwarding(5)
)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74642&edit=1