note 29754 added to function.snmprealwalk

From: Date: Mon, 24 Feb 2003 11:30:30 +0000
Subject: note 29754 added to function.snmprealwalk
Groups: php.notes 
Request: Send a blank email to php-notes+get-44425@lists.php.net to get a copy of this message
snmprealwalk indexes the values using the oid instead of an integer. This is useful when you need data that is contained in the oid as well as the value. Here's an example for retrieving and printing vlan info: // // I have collected the vlan identifiers earlier from the 3com mib and they are stored in the $vlan table. // for($n=0;$n<count($vlan);$n++){ print $vlan[$n][id]." ".$vlan[$n][name]."<br>\n"; $ifStackStatusTable=@snmprealwalk($switch, $community, ".1.3.6.1.2.1.31.1.2.1.3.".$vlan[$n][id]); // ifMIB.ifMIBObjects.ifStackTable.ifStackEntry.ifStackStatus for(reset($ifStackStatusTable); $port = key($ifStackStatusTable); next($ifStackStatusTable)){ print "$port=$ifStackStatusTable[$port]<br>"; } -- http://www.php.net/manual/en/function.snmprealwalk.php http://master.php.net/manage/user-notes.php?action=edit+29754 http://master.php.net/manage/user-notes.php?action=delete+29754 http://master.php.net/manage/user-notes.php?action=reject+29754

« previous php.notes (#44425) next »