|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-06-05 14:36 UTC] richarde at eskom dot co dot za
Simple code like the code below generates ugly messages in the php code if the host has an error or is unable to connect for some reason:
$networks = snmpwalk('100.100.100.100', 'public', ".1.3.6.1.2.1.4.21.1.1");
These types of errors are shown:
Warning: No Response from 147.110.52.xx in /home/httpd/html/iptrack/test.php3 on line 20
This is in contradiction to what it states in the manual:
array snmpwalk (string hostname, string community, string object_id [, int timeout [, int retries]])
Returns an array of SNMP object values starting from the object_id() as root and false on error.
I think all the snmp functions have the same problems.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 01:00:01 2025 UTC |
This is not a bug. This is how all PHP functions behave in case of errors. You can set many error reporting directives in php.ini which control how the errors are reported. Or you can use @ in front of function which will make it not to print out any errors: $networks = @snmpwalk('100.100.100.100', 'public', ".1.3.6.1.2.1.4.21.1.1"); Manual is your friend, read it sometimes.. :) --Jani