HI,

This is the same as you have send to the net-snmp-users
mailinglist, right??
If not let me know.


Harrie
On Thursday, December 26, 2002, at 09:06 PM, Johann Hanne wrote:


Hi,

is somebody actually maintaining the SNMP module? I'm currently using PHP
4.2.3 and I have two major problems which make the SNMP functions
unusable for me:
- When using snmpwalkoid() the array keys are the OIDs. But if the OID is
lying under certain subtrees (e.g. mib-2, experimental, private), all
the OID bits leading to that path are dropped (i.e. the OID is
shortened). Furthermore known OID numbers are replaced with their
textual representation, which makes the array keys dependent on
the locally existing MIBs. All this makes it impossible to reliably
parse the returned OIDs!
A PHP function which calls
ds_toggle_boolean(DS_LIBRARY_ID, DS_LIB_PRINT_NUMERIC_OIDS);
and
ds_toggle_boolean(DS_LIBRARY_ID, DS_LIB_PRINT_FULL_OID);
to turn these "features" off is required. And IMHO this should
be the default behaviour.
- Returned OID values are read via the sprint_value() SNMP API function.
This preparses the values and results in strings like "Timeticks: ...",
"Hex: ...". It is extremely hard (read: impossible) to reliably parse
these values for further processing.
This behaviour could also be turned off with ds_toggle_boolean() calls,
but it's even better to do the parsing in a special function. This
way, even the type of the value could be returned optionally.

Two other things in the related PHP source code might be regarded as...
ermmm... questionable:
- sprint_value() and sprint_objid() are used. It seems to me that these
functions don't do any overflow checking? And they are not documented,
thus probably obsolete (sprint_variable() is documented as obsolete
in the mib_api man page).
- Is it really wise to use ONE function for ALL SNMP operations (get, set,
walk)? The code is hard to read and confusing. IMHO the function should
at least be splitted up into a single-OID-function (set, get) and a
multiple-OIDs-function (walk).

Comments?

Cheers, Jonny <[EMAIL PROTECTED]>




--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php


--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to