new mac address search

git-svn-id: http://www.observium.org/svn/observer/trunk@2151 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2011-04-24 00:28:09 +00:00
parent 28b98dad8d
commit c6964aec37
6 changed files with 117 additions and 6 deletions

View File

@@ -123,6 +123,21 @@ while ($port = mysql_fetch_assoc($port_query))
$this_port['ifOutOctets'] = $this_port['ifHCOutOctets'];
}
### rewrite the ifPhysAddress
if(strpos($this_port['ifPhysAddress'], ":"))
{
list($a_a, $a_b, $a_c, $a_d, $a_e, $a_f) = explode(":", $this_port['ifPhysAddress']);
$ah_a = zeropad(dechex($a_a));
$ah_b = zeropad(dechex($a_b));
$ah_c = zeropad(dechex($a_c));
$ah_d = zeropad(dechex($a_d));
$ah_e = zeropad(dechex($a_e));
$ah_f = zeropad(dechex($a_f));
#$this_port['ifPhysAddress'] = $ah_a.":".$ah_b.":".$ah_c.":".$ah_d.":".$ah_e.":".$ah_f;
$this_port['ifPhysAddress'] = $ah_a.$ah_b.$ah_c.$ah_d.$ah_e.$ah_f;
}
if (is_numeric($this_port['ifHCInBroadcastPkts']) && is_numeric($this_port['ifHCOutBroadcastPkts']) && is_numeric($this_port['ifHCInMulticastPkts']) && is_numeric($this_port['ifHCOutMulticastPkts']))
{
echo("HC ");
@@ -319,4 +334,4 @@ while ($port = mysql_fetch_assoc($port_query))
#### Clear Variables Here
unset($port_stats);
?>
?>