mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
moving things around, making things tidier
git-svn-id: http://www.observium.org/svn/observer/trunk@406 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -27,7 +27,7 @@ echo("
|
||||
|
||||
if($peer['bgpPeerRemoteAs'] == $device['bgpLocalAs']) { $peer_type = "<span style='color: #00f;'>iBGP</span>"; } else { $peer_type = "<span style='color: #0a0;'>eBGP</span>"; }
|
||||
|
||||
$peerhost = mysql_fetch_array(mysql_query("SELECT * FROM ipaddr AS A, interfaces AS I, devices AS D WHERE A.addr = '".$peer['bgpPeerIdentifier']."' AND I.interface_id = A.interface_id AND D.device_id = I.device_id"));
|
||||
$peerhost = mysql_fetch_array(mysql_query("SELECT * FROM ipv4_addresses AS A, interfaces AS I, devices AS D WHERE A.ipv4_address = '".$peer['bgpPeerIdentifier']."' AND I.interface_id = A.interface_id AND D.device_id = I.device_id"));
|
||||
|
||||
if($peerhost) { $peername = generatedevicelink($peerhost); } else { unset($peername); }
|
||||
|
||||
|
@@ -17,8 +17,8 @@ while($device = mysql_fetch_array($device_query)) {
|
||||
echo("<br />");
|
||||
}
|
||||
|
||||
include("blocks/netstats.inc.php");
|
||||
include("blocks/uptime.inc.php");
|
||||
include("graphs/netstats.inc.php");
|
||||
include("graphs/uptime.inc.php");
|
||||
|
||||
break;
|
||||
|
||||
@@ -31,8 +31,8 @@ while($device = mysql_fetch_array($device_query)) {
|
||||
echo("<div class=graphhead>Firewall Sessions</div>");
|
||||
$graph_type = "fortigate_sessions"; include ("includes/print-device-graph.php");
|
||||
|
||||
include("blocks/netstats.inc.php");
|
||||
include("blocks/uptime.inc.php");
|
||||
include("graphs/netstats.inc.php");
|
||||
include("graphs/uptime.inc.php");
|
||||
|
||||
break;
|
||||
|
||||
@@ -47,8 +47,8 @@ while($device = mysql_fetch_array($device_query)) {
|
||||
$graph_type = "adsl_atn"; include ("includes/print-device-graph.php");
|
||||
echo("<br />");
|
||||
|
||||
include("blocks/netstats.inc.php");
|
||||
include("blocks/uptime.inc.php");
|
||||
include("graphs/netstats.inc.php");
|
||||
include("graphs/uptime.inc.php");
|
||||
|
||||
break;
|
||||
|
||||
@@ -61,8 +61,8 @@ while($device = mysql_fetch_array($device_query)) {
|
||||
$graph_type = "netscreen_sessions"; include ("includes/print-device-graph.php");
|
||||
|
||||
|
||||
include("blocks/netstats.inc.php");
|
||||
include("blocks/uptime.inc.php");
|
||||
include("graphs/netstats.inc.php");
|
||||
include("graphs/uptime.inc.php");
|
||||
|
||||
break;
|
||||
|
||||
@@ -129,8 +129,8 @@ while($device = mysql_fetch_array($device_query)) {
|
||||
echo("<br />");
|
||||
}
|
||||
|
||||
include("blocks/netstats.inc.php");
|
||||
include("blocks/uptime.inc.php");
|
||||
include("graphs/netstats.inc.php");
|
||||
include("graphs/uptime.inc.php");
|
||||
|
||||
echo("<div class=graphhead>System Load</div>");
|
||||
$graph_type = "load"; include ("includes/print-device-graph.php");
|
||||
@@ -177,8 +177,8 @@ while($device = mysql_fetch_array($device_query)) {
|
||||
echo("<br />");
|
||||
}
|
||||
|
||||
include("blocks/netstats.inc.php");
|
||||
include("blocks/uptime.inc.php");
|
||||
include("graphs/netstats.inc.php");
|
||||
include("graphs/uptime.inc.php");
|
||||
break;
|
||||
case "Snom":
|
||||
echo("<div class=graphhead>Calls</div>");
|
||||
|
@@ -39,9 +39,16 @@ if(mysql_result(mysql_query("SELECT count(*) from cpmCPU WHERE device_id = '" .
|
||||
$i = '1';
|
||||
$procs = mysql_query("SELECT * FROM `cpmCPU` WHERE device_id = '" . $device['device_id'] . "'");
|
||||
while($proc = mysql_fetch_array($procs)) {
|
||||
|
||||
$proc_url = "?page=device/".$device['device_id']."/sensors/processors/";
|
||||
|
||||
$proc_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$proc['entPhysicalDescr'];
|
||||
$proc_popup .= "</div><img src=\'graph.php?id=" . $proc['cpmCPU_id'] . "&type=cpmCPU&from=$month&to=$now&width=400&height=125\'>";
|
||||
$proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
|
||||
|
||||
if($proc['cpuCPMTotal5minRev'] > '60') { $proc_colour='#cc0000'; } else { $proc_colour='#0000cc'; }
|
||||
echo("<tr><td class=tablehead><a href='' $proc_popup>" . $proc['entPhysicalDescr'] . "</a></td>
|
||||
<td><a href='#' $fs_popup><img src='percentage.php?per=" . $proc['cpmCPUTotal5minRev'] . "'></a></td>
|
||||
<td><a href='#' $proc_popup><img src='percentage.php?per=" . $proc['cpmCPUTotal5minRev'] . "'></a></td>
|
||||
<td style='font-weight: bold; color: $drv_colour'>" . $proc['cpmCPUTotal5minRev'] . "%</td>
|
||||
</tr>");
|
||||
$i++;
|
||||
@@ -50,6 +57,39 @@ if(mysql_result(mysql_query("SELECT count(*) from cpmCPU WHERE device_id = '" .
|
||||
echo("</div>");
|
||||
}
|
||||
|
||||
if(mysql_result(mysql_query("SELECT count(*) from cempMemPool WHERE device_id = '" . $device['device_id'] . "'"),0)) {
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
echo("<p class=sectionhead>Memory Pools</p>");
|
||||
echo("<table width=100%>");
|
||||
$i = '1';
|
||||
$mempools = mysql_query("SELECT * FROM `cempMemPool` WHERE device_id = '" . $device['device_id'] . "'");
|
||||
while($mempool = mysql_fetch_array($mempools)) {
|
||||
$entPhysicalName = mysql_result(mysql_query("SELECT entPhysicalName from entPhysical WHERE device_id = '".$device['device_id']."'
|
||||
AND entPhysicalIndex = '".$mempool['entPhysicalIndex']."'"),0);
|
||||
$perc = round($mempool['cempMemPoolUsed'] / ($mempool['cempMemPoolUsed'] + $mempool['cempMemPoolFree']) * 100,2);
|
||||
$mempool['descr_fixed'] = $entPhysicalName . " ". $mempool['cempMemPoolName'];
|
||||
$mempool['descr_fixed'] = str_replace("Routing Processor", "RP", $mempool['descr_fixed']);
|
||||
$mempool['descr_fixed'] = str_replace("Switching Processor", "SP", $mempool['descr_fixed']);
|
||||
$mempool['descr_fixed'] = str_replace("Processor", "Proc", $mempool['descr_fixed']);
|
||||
|
||||
$proc_url = "?page=device/".$device['device_id']."/sensors/mempools/";
|
||||
|
||||
$mempool_popup = "onmouseover=\"return overlib('<div class=list-large>".$device['hostname']." - ".$mempool['descr_fixed'];
|
||||
$mempool_popup .= "</div><img src=\'graph.php?id=" . $mempool['cempMemPool_id'] . "&type=cempMemPool&from=$month&to=$now&width=400&height=125\'>";
|
||||
$mempool_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
|
||||
|
||||
|
||||
if($mempool['cpuCPMTotal5minRev'] > '60') { $mempool_colour='#cc0000'; } else { $mempool_colour='#0000cc'; }
|
||||
echo("<tr><td class=tablehead><a href='' $mempool_popup>" . $mempool['descr_fixed'] ."</a></td>
|
||||
<td><a href='#' $mempool_popup><img src='percentage.php?per=" . $perc . "'></a></td>
|
||||
<td style='font-weight: bold; color: $drv_colour'>$perc%</td>
|
||||
<td style='color: $drv_colour'>" . formatstorage($mempool['cempMemPoolFree'], 0) . "/" . formatstorage($mempool['cempMemPoolUsed'] + $mempool['cempMemPoolFree'], 0) . "</strong></td>
|
||||
</tr>");
|
||||
$i++;
|
||||
}
|
||||
echo("</table>");
|
||||
echo("</div>");
|
||||
}
|
||||
|
||||
if(mysql_result(mysql_query("SELECT count(storage_id) from storage WHERE host_id = '" . $device['device_id'] . "'"),0)) {
|
||||
echo("<div style='background-color: #eeeeee; margin: 5px; padding: 5px;'>");
|
||||
|
@@ -1,7 +1,8 @@
|
||||
<?php
|
||||
echo("
|
||||
<div style='width: 100%; text-align: right; padding-bottom: 10px; clear: both; display:block; height:20px;'>
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/'>Details</a> | Graphs:
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/'>Basic</a> |
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/details/'>Details</a> | Graphs:
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/graphs/bits/'>Bits</a> |
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/graphs/pkts/'>Packets</a> |
|
||||
<a href='".$config['base_url']."/device/" . $device['device_id'] . "/ports/graphs/nupkts/'>NU Packets</a> |
|
||||
@@ -17,6 +18,11 @@ if($_GET['opta'] == graphs ) {
|
||||
$dographs = 1;
|
||||
}
|
||||
|
||||
if($_GET['opta'] == "details" ) {
|
||||
$port_details = 1;
|
||||
}
|
||||
|
||||
|
||||
$hostname = gethostbyid($device['device_id']);
|
||||
|
||||
echo("<div style='margin: 5px;'><table border=0 cellspacing=0 cellpadding=5 width=100%>");
|
||||
|
Reference in New Issue
Block a user