mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fixes. speed improvements.
git-svn-id: http://www.observium.org/svn/observer/trunk@2602 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -179,6 +179,8 @@ if (strpos($port['label'], "oopback") === false && !$graph_type)
|
||||
}
|
||||
}
|
||||
|
||||
if ($port_details)
|
||||
{
|
||||
foreach ($int_links as $int_link)
|
||||
{
|
||||
$link_if = dbFetchRow("SELECT * from ports AS I, devices AS D WHERE I.device_id = D.device_id and I.interface_id = ?", array($int_link));
|
||||
@@ -194,55 +196,58 @@ if (strpos($port['label'], "oopback") === false && !$graph_type)
|
||||
if ($int_links_v4[$int_link]) { echo(" <b style='color: #00a100'>v4</b>"); }
|
||||
$br = "<br />";
|
||||
}
|
||||
}
|
||||
# unset($int_links, $int_links_v6, $int_links_v4, $int_links_phys, $br);
|
||||
}
|
||||
|
||||
foreach (dbFetchRows("SELECT * FROM `pseudowires` WHERE `interface_id` = ?", array($port['interface_id'])) as $pseudowire)
|
||||
if ($port_details)
|
||||
{
|
||||
#`interface_id`,`peer_device_id`,`peer_ldp_id`,`cpwVcID`,`cpwOid`
|
||||
foreach (dbFetchRows("SELECT * FROM `pseudowires` WHERE `interface_id` = ?", array($port['interface_id'])) as $pseudowire)
|
||||
{
|
||||
#`interface_id`,`peer_device_id`,`peer_ldp_id`,`cpwVcID`,`cpwOid`
|
||||
$pw_peer_dev = dbFetchRow("SELECT * FROM `devices` WHERE `device_id` = ?", array($pseudowire['peer_device_id']));
|
||||
$pw_peer_int = dbFetchRow("SELECT * FROM `ports` AS I, pseudowires AS P WHERE I.device_id = ? AND P.cpwVcID = ? AND P.interface_id = I.interface_id", array($pseudowire['peer_device_id'], $pseudowire['cpwVcID']));
|
||||
|
||||
$pw_peer_int = ifNameDescr($pw_peer_int);
|
||||
echo("$br<img src='images/16/arrow_switch.png' align=absmiddle><b> " . generate_port_link($pw_peer_int, makeshortif($pw_peer_int['label'])) ." on ". generate_device_link($pw_peer_dev, shorthost($pw_peer_dev['hostname'])) . "</b>");
|
||||
$br = "<br />";
|
||||
}
|
||||
}
|
||||
|
||||
foreach(dbFetchRows("SELECT * FROM `ports` WHERE `pagpGroupIfIndex` = ? and `device_id` = ?", array($port['ifIndex'], $device['device_id'])) as $member)
|
||||
{
|
||||
foreach(dbFetchRows("SELECT * FROM `ports` WHERE `pagpGroupIfIndex` = ? and `device_id` = ?", array($port['ifIndex'], $device['device_id'])) as $member)
|
||||
{
|
||||
echo("$br<img src='images/16/brick_link.png' align=absmiddle> <strong>" . generate_port_link($member) . " (PAgP)</strong>");
|
||||
$br = "<br />";
|
||||
}
|
||||
}
|
||||
|
||||
if ($port['pagpGroupIfIndex'] && $port['pagpGroupIfIndex'] != $port['ifIndex'])
|
||||
{
|
||||
if ($port['pagpGroupIfIndex'] && $port['pagpGroupIfIndex'] != $port['ifIndex'])
|
||||
{
|
||||
$parent = dbFetchRow("SELECT * FROM `ports` WHERE `ifIndex` = ? and `device_id` = ?", array($port['pagpGroupIfIndex'], $device['device_id']));
|
||||
echo("$br<img src='images/16/bricks.png' align=absmiddle> <strong>" . generate_port_link($parent) . " (PAgP)</strong>");
|
||||
$br = "<br />";
|
||||
}
|
||||
}
|
||||
|
||||
foreach(dbFetchRows("SELECT * FROM `ports_stack` WHERE `interface_id_low` = ? and `device_id` = ?", array($port['ifIndex'], $device['device_id'])) as $higher_if)
|
||||
{
|
||||
foreach(dbFetchRows("SELECT * FROM `ports_stack` WHERE `interface_id_low` = ? and `device_id` = ?", array($port['ifIndex'], $device['device_id'])) as $higher_if)
|
||||
{
|
||||
if ($higher_if['interface_id_high'])
|
||||
{
|
||||
$this_port = get_port_by_index_cache($device['device_id'], $higher_if['interface_id_high']);
|
||||
echo("$br<img src='images/16/arrow_divide.png' align=absmiddle> <strong>" . generate_port_link($this_port) . "</strong>");
|
||||
$br = "<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach(dbFetchRows("SELECT * FROM `ports_stack` WHERE `interface_id_high` = ? and `device_id` = ?", array($port['ifIndex'], $device['device_id'])) as $lower_if)
|
||||
{
|
||||
foreach(dbFetchRows("SELECT * FROM `ports_stack` WHERE `interface_id_high` = ? and `device_id` = ?", array($port['ifIndex'], $device['device_id'])) as $lower_if)
|
||||
{
|
||||
if ($lower_if['interface_id_low'])
|
||||
{
|
||||
$this_port = get_port_by_index_cache($device['device_id'], $lower_if['interface_id_low']);
|
||||
echo("$br<img src='images/16/arrow_join.png' align=absmiddle> <strong>" . generate_port_link($this_port) . "</strong>");
|
||||
$br = "<br />";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
unset($int_links, $int_links_v6, $int_links_v4, $int_links_phys, $br);
|
||||
|
||||
echo("</td></tr>");
|
||||
|
@@ -30,8 +30,6 @@ function dbQuery($sql, $parameters = array()) {
|
||||
$time_start = microtime(true);
|
||||
*/
|
||||
|
||||
# echo($fullSql);
|
||||
|
||||
$result = mysql_query($fullSql); // sets $this->result
|
||||
/*
|
||||
if($this->logFile) {
|
||||
@@ -286,6 +284,7 @@ function dbFetchKeyValue($sql, $parameters = array()) {
|
||||
*/
|
||||
function dbMakeQuery($sql, $parameters) {
|
||||
// bypass extra logic if we have no parameters
|
||||
|
||||
if(sizeof($parameters) == 0)
|
||||
return $sql;
|
||||
|
||||
@@ -300,6 +299,7 @@ function dbMakeQuery($sql, $parameters) {
|
||||
$namedParams[ ':' . $key ] = $value;
|
||||
}
|
||||
}
|
||||
|
||||
// sort namedParams in reverse to stop substring squashing
|
||||
krsort($namedParams);
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
#!/usr/bin/php -q
|
||||
<?php
|
||||
/*
|
||||
ex: set tabstop=4 shiftwidth=4 autoindent:
|
||||
+-------------------------------------------------------------------------+
|
||||
|
Reference in New Issue
Block a user