$b = @snmpwalkoid ($_POST["Adresse_IP"], $_POST["comm"], ".1.3.6.1.2.1.17.4.3.1.2");
If ($b != FALSE)
foreach ($b as $key => $port ) {
$mac = substr ($key, 26);
$tab = explode(".", $mac);
printf ("%02x-%02x-%02x-%02x-%02x-%02x : %d<br>", $tab[0], $tab[1], $tab[2], $tab[3], $tab[4], $tab[5], $port); }
for ($i = 1; $i != FALSE; $i++)
{
$nom_port = @snmpget ($_POST["Adresse_IP"], $_POST["comm"], ".1.3.6.1.2.1.31.1.1.1.1.".$i);
$nomport = substr ($nom_port, 4);
if ($nom_port != FALSE) {
echo "$tab $nomport <br>";}}
Partager