hello,
it seems that there are some problems with the a-
series switches from hp.
While the command "show ip mapping" is working
fine:
root@nextgen3:/var/www/safe/tenere# scli mycomm@switch-core-
virt-1 -c "show ip mapping"
100 scli version 0.4.0 (c) 2001-2010
Juergen Schoenwaelder
INTERFACE STATUS ADDRESS LOWER LAYER
ADDRESS
33 dynamic 172.16.1.4 c0:8c:60:44:00:05
33
dynamic 172.16.1.10 d0:7e:28:ee:01:bc
33 dynamic
172.16.1.11 d0:7e:28:f0:f2:8d
34 dynamic 172.16.2.20
84:8f:69:cc:2f:d6
34 dynamic 172.16.2.55 96:50:68:91:b5:9b
34 dynamic 172.16.2.149 06:44:69:91:f7:11
34
dynamic 172.16.2.220 00:25:90:59:f7:dc
38 dynamic
192.135.27.216 12:7a:7f:f1:ba:23
the command output of "show bridge
forwarding" seems empty:
root@nextgen3:/var/www/safe/tenere# scli
E=mc^2@switch-core-virt-1 -c "show bridge forwarding"
100 scli
version 0.4.0 (c) 2001-2010 Juergen Schoenwaelder
At the present, in
order to retrieve the forwarding database, I am using this php script:
<?php
function extract_macaddr($pezzi, &$macaddr)
{
$macaddr ="";
$s="";
for ($z=1; $z<7; $z++)
{
if ($pezzi[$z]<16)
$v="
0";
else
$v="";
$macaddr = $macaddr . "$s$v" . dechex
($pezzi[$z]);
$s=":";
}
}
//------------------------------------------------------------- Main
$sw = $_GET['sw']; //switchname
snmp_set_valueretrieval
(SNMP_VALUE_PLAIN );
snmp_set_oid_output_format
(SNMP_OID_OUTPUT_NUMERIC);
$oid_a = ".iso.3.6.1.2.1.17.7.1.2.2.1.2";
// $oid_b = ".iso.3.6.1.2.1.17.7.1.2.2.1.3";
$spo = strlen($oid_a);
//
$a = snmp2_real_walk($sw, "mycomm", $oid_a );
$vlan =array();
$port=array();
echo "<div style=\"width:800px; margin-left:auto;
margin-right:auto \" >";
foreach ($a as $key => $value )
{
$macinfo = substr($key,$spo-1,strlen($key)-$spo);
$pezzi =
explode(".",$macinfo);
$cvlan=$pezzi
[0]; // pezzi mean chunks
echo "$key *** $macinfo *** $cvlan *** $value <br>\n";
//debug output omitted below
extract_macaddr($pezzi,
$macaddr);
$port[$macaddr] = $value;
$vlan[$macaddr] =
$cvlan;
echo "======> $i ====", $macad[$value][$i], "<br>\n";
//debug output omitted below
$i++;
}
echo
"=====================================<br>\n";
array_multisort($port,
$vlan);
foreach ($port as $kk => $vv )
{
echo "$kk $vv $vlan[$kk]
<br>\n";
}
echo "</div>";
?>
It works returning mac, port and vlan:
...omissis....
=====================================
d0:7e:28:f0:f2:0e
97 1
d0:7e:28:f0:f2:14 97 1
12:7a:7f:f1:ba:03 97 27
00:25:90:59:f7:16
97 27
c0:8c:60:44:00:00 145 1
d0:7e:28:ee:01:12 168 1
d0:7e:28:ee:01:18
168 1
96:50:68:91:b5:0f 168 2
00:25:90:59:f9:12 168 2
84:8f:69:cc:2f:15
168 2
but it would be better if somebody can update scli...
Many
thanks,
Nazzareno Taborgna
==============
Invita i tuoi amici e Tiscali ti premia! Il consiglio di un amico vale più di uno spot in TV. Per ogni nuovo abbonato 30 € di premio per te e per lui! Un amico al mese e parli e navighi sempre gratis: http://freelosophy.tiscali.it/