snmp replies not printed
| From: | Razvan Cosma | Date: | Thu, 16 May 2002 13:06:45 +0000 |
| Subject: | snmp replies not printed | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-97904@lists.php.net to get a copy of this message | ||
Hello,
I have installed php 4.1.2 and ucd 4.2.4 both from tarballs on a linux
box, and compiled php both as an apache module and standalone (same
options, except for the --with-apxs). Now, when I use snmpwalk or whatever
other function from within apache, it works (almost) correctly:
snmp_set_quick_print causes php to return both the OID and the value
although the manual says different, but I can live with that. the
problem is that a simple script run from the standalone interpreter on
the same machine behaves very strange. Example:
#!/usr/local/bin/php -q
<?
snmp_set_quick_print(1);
$test=snmpwalk("1.2.3.4","public","system");
for (reset($test); $i = key($test); next($i)){
echo "$test[$i]\n";
}
does not print ANYTHING (nothing in php.log, also. I have
error_reporting = E_ALL in php.ini)
but if I do a snmpget("1.2.3.4","public","system.sysName.0")
I get
system.sysName.0 sysName not set
which is (almost) correct.
the snmp* commands from the ucd-snmp package work just fine.
Does anyone have some clue on what could have happened?
Thank you.