move from port_id to interface_id. make ports discovery only discover. add some cleaner functions. add a tiny bit of alerting infrastructure.

git-svn-id: http://www.observium.org/svn/observer/trunk@3195 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Adam Amstrong
2012-05-16 13:25:50 +00:00
parent 2e2379a8a1
commit 4db1454e92
100 changed files with 525 additions and 928 deletions

View File

@@ -24,21 +24,21 @@ print_optionbar_end();
echo("<table cellpadding=5 cellspacing=0 class=devicetable width=100%>");
foreach (dbFetchRows("SELECT * FROM pseudowires AS P, ports AS I WHERE P.interface_id = I.interface_id AND I.device_id = ? ORDER BY I.ifDescr", array($device['device_id'])) as $pw_a)
foreach (dbFetchRows("SELECT * FROM pseudowires AS P, ports AS I WHERE P.port_id = I.port_id AND I.device_id = ? ORDER BY I.ifDescr", array($device['device_id'])) as $pw_a)
{
$i = 0;
while ($i < count($linkdone))
{
$thislink = $pw_a['device_id'] . $pw_a['interface_id'];
$thislink = $pw_a['device_id'] . $pw_a['port_id'];
if ($linkdone[$i] == $thislink) { $skip = "yes"; }
$i++;
}
$pw_b = dbFetchRow("SELECT * from `devices` AS D, `ports` AS I, `pseudowires` AS P WHERE D.device_id = ? AND D.device_id = I.device_id
AND P.cpwVcID = ? AND P.interface_id = I.interface_id", array($pw_a['peer_device_id'], $pw_a['cpwVcID']));
AND P.cpwVcID = ? AND P.port_id = I.port_id", array($pw_a['peer_device_id'], $pw_a['cpwVcID']));
if (!port_permitted($pw_a['interface_id'])) { $skip = "yes"; }
if (!port_permitted($pw_b['interface_id'])) { $skip = "yes"; }
if (!port_permitted($pw_a['port_id'])) { $skip = "yes"; }
if (!port_permitted($pw_b['port_id'])) { $skip = "yes"; }
if ($skip)
{
@@ -88,7 +88,7 @@ foreach (dbFetchRows("SELECT * FROM pseudowires AS P, ports AS I WHERE P.interfa
echo("</td></tr>");
}
$linkdone[] = $pw_b['device_id'] . $pw_b['interface_id'];
$linkdone[] = $pw_b['device_id'] . $pw_b['port_id'];
}
}