fixing ipv6

git-svn-id: http://www.observium.org/svn/observer/trunk@273 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2008-11-03 17:21:48 +00:00
parent 64e4c9bac6
commit 890b12b2d1

View File

@@ -1,8 +1,12 @@
<?php <?php
echo("IPv6 Addresses : "); echo("IPv6 Addresses : ");
$oids = trim(shell_exec($config['snmpwalk']." -".$device['snmpver']." -c ".$device['community']." ".$device['hostname']." ipAddressIfIndex.ipv6 -Osq")); $ipv6interfaces = shell_exec($config['snmpget']." -Ovnq -".$device['snmpver']." -c ".$device['community']." ".$device['hostname']." ipv6Interfaces.0");
if($ipv6interfaces){
$oids = trim(shell_exec($config['snmpwalk']." -".$device['snmpver']." -Ln -c ".$device['community']." ".$device['hostname']." ipAddressIfIndex.ipv6 -Osq | grep -v No"));
$oids = str_replace("ipAddressIfIndex.ipv6.", "", $oids); $oids = str_replace("\"", "", $oids); $oids = trim($oids); $oids = str_replace("ipAddressIfIndex.ipv6.", "", $oids); $oids = str_replace("\"", "", $oids); $oids = trim($oids);
foreach(explode("\n", $oids) as $data) { foreach(explode("\n", $oids) as $data) {
$data = trim($data); $data = trim($data);
@@ -44,5 +48,7 @@
} }
} else { echo("."); } } else { echo("."); }
} }
} else { echo("None configured"); }
?> ?>