mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Lots of pretty things!
git-svn-id: http://www.observium.org/svn/observer/trunk@99 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -5,7 +5,6 @@ while($device = mysql_fetch_array($device_query)) {
|
||||
$hostname = $device[hostname];
|
||||
$bg="#ffffff";
|
||||
|
||||
|
||||
echo("<div style='clear: both;'>");
|
||||
|
||||
switch ($device['os']) {
|
||||
@@ -62,13 +61,13 @@ while($device = mysql_fetch_array($device_query)) {
|
||||
|
||||
if(mysql_result(mysql_query("SELECT count(storage_id) FROM storage WHERE host_id = '" . $device['device_id'] . "'"),0)) {
|
||||
echo("<div class=graphhead>Storage</div>");
|
||||
$graph_type = "unixfs"; include ("includes/print-device-graph.php");
|
||||
$graph_type = "unixfs_dev"; include ("includes/print-device-graph.php");
|
||||
echo("<br />");
|
||||
}
|
||||
|
||||
if(mysql_result(mysql_query("SELECT count(*) FROM temperature WHERE temp_host = '" . $device['device_id'] . "'"),0)) {
|
||||
echo("<div class=graphhead>Temperatures</div>");
|
||||
$graph_type = "temp"; include ("includes/print-device-graph.php");
|
||||
$graph_type = "dev_temp"; include ("includes/print-device-graph.php");
|
||||
echo("<br />");
|
||||
}
|
||||
echo("<div class=graphhead>IP Statistics</div>");
|
||||
@@ -124,9 +123,9 @@ while($device = mysql_fetch_array($device_query)) {
|
||||
echo("<br />");
|
||||
$graph_type = "mem"; include ("includes/print-device-graph.php");
|
||||
echo("<br />");
|
||||
if(mysql_result(mysql_query("SELECT count(*) FROM temperature WHERE temp_host = '$device[id]'"),0)) {
|
||||
if(mysql_result(mysql_query("SELECT count(*) FROM temperature WHERE temp_host = '" . $device['device_id'] . "'"),0)) {
|
||||
echo("<div class=graphhead>Temperatures</div>");
|
||||
$graph_type = "temp"; include ("includes/print-device-graph.php");
|
||||
$graph_type = "dev_temp"; include ("includes/print-device-graph.php");
|
||||
echo("<br />");
|
||||
}
|
||||
echo("<div class=graphhead>IP Statistics</div>");
|
||||
|
||||
@@ -37,6 +37,7 @@ if(mysql_result(mysql_query("SELECT count(storage_id) from storage WHERE host_id
|
||||
echo("<p class=sectionhead>Storage</p>");
|
||||
echo("<table width=100%>");
|
||||
$i = '1';
|
||||
|
||||
echo("<tr class=tablehead><td>Mountpoint</td><td width=203>Usage</td><td width=40>%</td><td width=75>Total</td>
|
||||
<td width=75>Used</td></tr>");
|
||||
$drives = mysql_query("SELECT * FROM `storage` WHERE host_id = '" . $device['device_id'] . "'");
|
||||
@@ -46,8 +47,12 @@ if(mysql_result(mysql_query("SELECT count(storage_id) from storage WHERE host_id
|
||||
$perc = $drive['storage_perc'];
|
||||
$total = formatStorage($total);
|
||||
$used = formatStorage($used);
|
||||
|
||||
$store_url = "graph.php?id=" . $drive['storage_id'] . "&type=unixfs&from=$month&to=$now&width=400&height=125";
|
||||
$store_popup = "onmouseover=\"return overlib('<img src=\'$store_url\'>', LEFT);\" onmouseout=\"return nd();\"";
|
||||
|
||||
if($perc > '80') { $drv_class='red'; } else { $drvclass=''; }
|
||||
echo("<tr><td class=tablehead>" . $drive['hrStorageDescr'] . "</td><td><img src='percentage.php?per=" . $perc . "'>
|
||||
echo("<tr><td class=tablehead>" . $drive['hrStorageDescr'] . "</td><td><a href='#' $store_popup><img src='percentage.php?per=" . $perc . "'></a>
|
||||
</td><td>" . $perc . "%</td><td>" . $total . "</td><td>" . $used . "</td></tr>");
|
||||
$i++;
|
||||
}
|
||||
|
||||
@@ -2,33 +2,25 @@
|
||||
if($bg == "#ffffff") { $bg = "#e5e5e5"; } else { $bg="#ffffff"; }
|
||||
echo("<table cellpadding=7 cellspacing=0 class=devicetable width=100%>");
|
||||
|
||||
if($_GET['id']) {
|
||||
$type = $_GET['id'];
|
||||
$sql = "select *, I.id as iid, I.ifIndex as ifIndex, D.id as did, D.hostname as hostname, I.if as ifname, I.name as ifalias ";
|
||||
$sql .= "from interfaces as I, devices as D WHERE `name` like '$type: %' AND I.host = D.id ORDER BY I.name";
|
||||
if($_GET['type']) {
|
||||
$type = $_GET['type'];
|
||||
$sql = "select * from interfaces as I, devices as D WHERE `ifAlias` like '$type: %' AND I.device_id = D.device_id ORDER BY I.ifAlias";
|
||||
$query = mysql_query($sql);
|
||||
while($data = mysql_fetch_array($query)) {
|
||||
$done = "yes";
|
||||
unset($class);
|
||||
$iid = $data[iid];
|
||||
$ifIndex = $data[ifIndex];
|
||||
$did = $data[did];
|
||||
$hostname = $data[hostname];
|
||||
$up = $data[up];
|
||||
$up_admin = $data[up_admin];
|
||||
$ifname = fixifname($data[ifname]);
|
||||
$ifalias = $data[ifalias];
|
||||
$ifalias = str_replace($type . ": ", "", $ifalias);
|
||||
$ifalias = str_replace("[PNI]", "Private", $ifalias);
|
||||
$ifclass = ifclass($up, $up_admin);
|
||||
$data['ifAlias'] = str_replace($type . ": ", "", $data['ifAlias']);
|
||||
$data['ifAlias'] = str_replace("[PNI]", "Private", $data['ifAlias']);
|
||||
$ifclass = ifclass($data['ifOperStatus'], $data['ifAdminStatus']);
|
||||
if($bg == "#ffffff") { $bg = "#e5e5e5"; } else { $bg="#ffffff"; }
|
||||
echo("<tr bgcolor='$bg'>
|
||||
<td><span class=interface><a href='?page=interface&id=$iid'>$ifalias</a></span><br />
|
||||
<span class=interface-desc><a href='?page=device&id=$did'>$hostname</a> <a href='?page=interface&id=$iid'>$ifname</a></span></td></tr><tr bgcolor='$bg'><td>");
|
||||
<td><span class=interface><a href='?page=interface&id=" . $data['interface_id'] . "'>" . $data['ifAlias'] . "</a></span><br />
|
||||
<span class=interface-desc><a href='?page=device&id=" . $data['device_id'] . "'>" . $data['hostname'] . "</a> <a href='?page=interface&id=" . $data['interface_id'] . "'>" . $data['ifDescr'] . "</a></span></td></tr><tr bgcolor='$bg'><td>");
|
||||
|
||||
if(file_exists("rrd/" . $hostname . ".". $ifIndex . ".rrd")) {
|
||||
if(file_exists("rrd/" . $data['hostname'] . "." . $data['ifIndex'] . ".rrd")) {
|
||||
|
||||
$graph_type = "bits";
|
||||
$iid = $data['interface_id'];
|
||||
include("includes/print-interface-graphs.php");
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user