diff --git a/html/graph.php b/html/graph.php
index bd1063b65..4a2ee770a 100644
--- a/html/graph.php
+++ b/html/graph.php
@@ -12,6 +12,7 @@ if($_GET['debug']) {
include("../config.php");
include("../includes/common.php");
include("../includes/graphing.php");
+ include("../includes/rewrites.php");
include("includes/authenticate.inc");
# if(!$_SESSION['authenticated']) { echo("not authenticated"); exit; }
diff --git a/html/includes/graphs/common.inc.php b/html/includes/graphs/common.inc.php
index a386a65ee..86c7177c4 100644
--- a/html/includes/graphs/common.inc.php
+++ b/html/includes/graphs/common.inc.php
@@ -4,24 +4,20 @@ if($_GET['from']) { $from = mres($_GET['from']); }
if($_GET['to']) { $to = mres($_GET['to']); }
if($_GET['width']) { $width = mres($_GET['width']); }
if($_GET['height']) { $height = mres($_GET['height']); }
-
-if($_GET['bg']) { $bg = mres($_GET['bg']); }
-
if($_GET['inverse']) { $in = 'out'; $out = 'in'; } else { $in = 'in'; $out = 'out'; }
if($_GET['legend'] == "no") { $rrd_options = " -g"; }
-#if($bg) { $rrd_options .= " -c CANVAS#" . $bg . " "; }
-
if(!$scale_min && !$scale_max) { $rrd_options .= " --alt-autoscale-max"; }
if(isset($scale_min)) { $rrd_options .= " -l $scale_min"; }
if(isset($scale_max)) { $rrd_options .= " -u $scale_max"; }
-
$rrd_options .= " -E --start ".$from." --end " . ($to - 150) . " --width ".$width." --height ".$height." ";
$rrd_options .= $config['rrdgraph_def_text'];
-$rrd_options .= " -c BACK#FFFFFF";
+if($_GET['bg']) { $rrd_options .= " -c CANVAS#" . mres($_GET['bg']) . " "; }
+
+#$rrd_options .= " -c BACK#FFFFFF";
if($height < "99") { $rrd_options .= " --only-graph"; }
if($width <= "300") { $rrd_options .= " --font LEGEND:7:".$config['mono_font']." --font AXIS:6:".$config['mono_font']." --font-render-mode normal";
diff --git a/html/includes/graphs/device_cpu_unix.inc.php b/html/includes/graphs/device_cpu_unix.inc.php
index b400b1aad..9513ef7e7 100644
--- a/html/includes/graphs/device_cpu_unix.inc.php
+++ b/html/includes/graphs/device_cpu_unix.inc.php
@@ -9,8 +9,8 @@ while($proc = mysql_fetch_array($query)) {
if(is_file($rrd_filename)) {
- $descr = str_pad($proc['hrDeviceDescr'], 8);
- $descr = substr($descr,0,8);
+ $descr = short_hrDeviceDescr($proc['hrDeviceDescr']);
+ $descr = str_replace(":", "\:", $descr);
$rrd_list[$i]['filename'] = $rrd_filename;
$rrd_list[$i]['descr'] = $descr;
diff --git a/html/includes/graphs/generic_multi_line.inc.php b/html/includes/graphs/generic_multi_line.inc.php
index af4e06eaf..1017570e0 100644
--- a/html/includes/graphs/generic_multi_line.inc.php
+++ b/html/includes/graphs/generic_multi_line.inc.php
@@ -2,13 +2,13 @@
include("common.inc.php");
- $unit_text = str_pad($unit_text, 10);
- $unit_text = substr($unit_text,0,10);
+ $unit_text = str_pad($unit_text, 13);
+ $unit_text = substr($unit_text,0,13);
$i = 0;
$iter = 0;
- $rrd_options .= " COMMENT:'".$unit_text." Last Min Max Avg\\n'";
+ $rrd_options .= " COMMENT:'".$unit_text." Cur Min Max Avg\\n'";
foreach($rrd_list as $rrd) {
@@ -20,12 +20,16 @@
$filename = $rrd['filename'];
$descr = $rrd['descr'];
- $id = $rra."_".$i;
+ $descr = substr(str_pad(short_hrDeviceDescr($rrd['descr']), 10),0,10);
+ $id = $rra."_".$i;
+
$rrd_options .= " DEF:".$id."=$filename:$rra:AVERAGE";
+ $rrd_options .= " DEF:".$id."min=$filename:$rra:MIN";
+ $rrd_options .= " DEF:".$id."max=$filename:$rra:MAX";
$rrd_options .= " LINE1.25:".$id."#".$colour.":'$descr'";
- $rrd_options .= " GPRINT:".$id.":LAST:%6.2lf GPRINT:".$id.":AVERAGE:%6.2lf";
- $rrd_options .= " GPRINT:".$id.":MAX:%6.2lf GPRINT:".$id.":AVERAGE:%6.2lf\\\\n";
+ $rrd_options .= " GPRINT:".$id.":LAST:%6.2lf GPRINT:".$id."min:MIN:%6.2lf";
+ $rrd_options .= " GPRINT:".$id."max:MAX:%6.2lf GPRINT:".$id.":AVERAGE:%6.2lf\\\\n";
$i++; $iter++;
}
diff --git a/html/includes/graphs/hrProcessor.inc.php b/html/includes/graphs/hrProcessor.inc.php
index 69efb98f1..cfa0c9361 100755
--- a/html/includes/graphs/hrProcessor.inc.php
+++ b/html/includes/graphs/hrProcessor.inc.php
@@ -13,8 +13,7 @@ include("common.inc.php");
if($iter=="1") {$colour="CC0000";} elseif($iter=="2") {$colour="008C00";} elseif($iter=="3") {$colour="4096EE";
} elseif($iter=="4") {$colour="73880A";} elseif($iter=="5") {$colour="D01F3C";} elseif($iter=="6") {$colour="36393D";
} elseif($iter=="7") {$colour="FF0084"; unset($iter); }
- $proc['descr_fixed'] = str_pad($proc['hrDeviceDescr'], 28);
- $proc['descr_fixed'] = substr($proc['descr_fixed'],0,28);
+ $proc['descr_fixed'] = substr(str_pad(short_hrDeviceDescr($proc['hrDeviceDescr']), 28),0,28);
$proc['descr_fixed'] = str_replace(":", "\:", $proc['descr_fixed']);
$rrd = $config['rrd_dir'] . "/".$proc['hostname']."/hrProcessor-" . $proc['hrDeviceIndex'] . ".rrd";
$rrd_options .= " DEF:proc" . $proc['hrDeviceIndex'] . "=$rrd:usage:AVERAGE ";
diff --git a/html/index.php b/html/index.php
index 65339ddc8..0bd130430 100755
--- a/html/index.php
+++ b/html/index.php
@@ -2,7 +2,7 @@
ini_set('allow_url_fopen', 0);
ini_set('display_errors', 0);
-
+#$debug=1;
if($debug) {
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
diff --git a/html/pages/device/health/hrprocessors.inc.php b/html/pages/device/health/hrprocessors.inc.php
index 7702c7127..b13d4c689 100644
--- a/html/pages/device/health/hrprocessors.inc.php
+++ b/html/pages/device/health/hrprocessors.inc.php
@@ -13,8 +13,9 @@
$proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
if($proc['cpuCPMTotal5minRev'] > '60') { $proc_colour='#cc0000'; } else { $proc_colour='#0000cc'; }
- echo("
| " . $proc['hrDeviceDescr'] . " |
-  |
+ echo("
| " . $proc['hrDeviceDescr'] . " |
+
+  |
" . $proc['hrProcessorLoad'] . "% |
");
diff --git a/html/pages/device/overview.inc.php b/html/pages/device/overview.inc.php
index 0612e49a6..1e562933c 100644
--- a/html/pages/device/overview.inc.php
+++ b/html/pages/device/overview.inc.php
@@ -31,137 +31,12 @@ echo("
echo("");
#}
-
-if(mysql_result(mysql_query("SELECT count(*) from cpmCPU WHERE device_id = '" . $device['device_id'] . "'"),0)) {
- echo("");
- echo("
Processors
");
- echo("
");
- $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']."/health/cpm/";
-
- $proc_popup = "onmouseover=\"return overlib('".$device['hostname']." - ".$proc['entPhysicalDescr'];
- $proc_popup .= "
";
- $proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
-
- if($proc['cpuCPMTotal5minRev'] > '60') { $proc_colour='#cc0000'; } else { $proc_colour='#0000cc'; }
- echo("| " . $proc['entPhysicalDescr'] . " |
-  |
- " . $proc['cpmCPUTotal5minRev'] . "% |
-
");
- $i++;
- }
- echo("
");
- echo("
");
-}
-
-if(mysql_result(mysql_query("SELECT count(*) from cempMemPool WHERE device_id = '" . $device['device_id'] . "'"),0)) {
- echo("");
- echo("
Memory Pools
");
- echo("
");
- $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']);
- $mempool['descr_fixed'] = str_replace("Sub-Module", "Mod", $mempool['descr_fixed']);
- $mempool['descr_fixed'] = str_replace("DFC Card", "DFC", $mempool['descr_fixed']);
-
- $proc_url = "?page=device/".$device['device_id']."/sensors/mempools/";
-
- $mempool_popup = "onmouseover=\"return overlib('".$device['hostname']." - ".$mempool['descr_fixed'];
- $mempool_popup .= "
";
- $mempool_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
-
-
- if($mempool['cpuCPMTotal5minRev'] > '60') { $mempool_colour='#cc0000'; } else { $mempool_colour='#0000cc'; }
- echo("| " . $mempool['descr_fixed'] ." |
-  |
- $perc% |
- " . formatstorage($mempool['cempMemPoolFree'], 0) . "/" . formatstorage($mempool['cempMemPoolUsed'] + $mempool['cempMemPoolFree'], 0) . " |
-
");
- $i++;
- }
- echo("
");
- echo("
");
-}
-
-if(mysql_result(mysql_query("SELECT count(storage_id) from storage WHERE host_id = '" . $device['device_id'] . "'"),0)) {
- echo("");
- echo("
Storage
");
- echo("
");
- $i = '1';
-
- echo("| Mountpoint | Usage | | Total |
- Used |
");
- $drives = mysql_query("SELECT * FROM `storage` WHERE host_id = '" . $device['device_id'] . "'");
- while($drive = mysql_fetch_array($drives)) {
- $total = $drive['hrStorageSize'] * $drive['hrStorageAllocationUnits'];
- $used = $drive['hrStorageUsed'] * $drive['hrStorageAllocationUnits'];
- $drive['perc'] = round($drive['storage_perc'], 0);
- $total = formatStorage($total);
- $used = formatStorage($used);
-
- $fs_url = "/device/".$device['device_id']."/health/storage/";
-
- $fs_popup = "onmouseover=\"return overlib('".$device['hostname']." - ".$drive['hrStorageDescr'];
- $fs_popup .= "
";
- $fs_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
-
- if($perc > '80') { $drv_colour='#cc0000'; } else { $drvclass='#0000cc'; }
- echo("| " . $drive['hrStorageDescr'] . " |
-  |
- " . $drive['perc'] . "% |
- " . $total . " |
- " . $used . " |
-
");
- $i++;
- }
- echo("
");
- echo("
");
-}
-
-unset($temp_seperator);
-if(mysql_result(mysql_query("SELECT count(temp_id) from temperature WHERE temp_host = '" . $device['device_id'] . "'"),0)) {
- $total = mysql_result(mysql_query("SELECT count(temp_id) from temperature WHERE temp_host = '" . $device['device_id'] . "'"),0);
- $rows = round($total / 2,0);
- echo("");
- echo("
Temperatures
");
- $i = '1';
- $temps = mysql_query("SELECT * FROM temperature WHERE temp_host = '" . $device['device_id'] . "'");
- echo("
");
- echo("");
- echo("");
- while($temp = mysql_fetch_array($temps)) {
- if(is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
-
- $temp_perc = $temp['temp_current'] / $temp['temp_limit'] * 100;
-
- $temp_colour = percent_colour($temp_perc);
- $temp_url = "graph.php?id=" . $temp['temp_id'] . "&type=temp&from=$month&to=$now&width=400&height=125";
- $temp_link = "";
- $temp_link .= $temp['temp_descr'] . "";
-
- $temp['temp_descr'] = truncate($temp['temp_descr'], 25, '');
- echo("| $temp_link | " . $temp['temp_current'] . "°C | ");
- if($i == $rows) { echo(" | "); }
- $i++;
- }
- echo(" ");
- echo(" |
");
- echo("
");
- echo("
");
-}
-
+include("overview/hrProcessors.inc.php");
+include("overview/cpmCPU.inc.php");
+include("overview/cemp.inc.php");
+include("overview/cmp.inc.php");
+include("overview/hrStorage.inc.php");
+include("overview/temperatures.inc.php");
echo("");
@@ -181,40 +56,7 @@ echo("
");
echo("");
-if($interfaces['total']) {
- echo("
- Total Traffic " . device_traffic_image($device['device_id'], 490, 100, $day, '-300s') . " ");
-}
-
-if($interfaces['total']) {
- echo("");
- echo(" Interfaces ");
-
-echo("
-
- |
- $interfaces[total] |
- $interfaces[up] |
- $interfaces[down] |
- $interfaces[disabled] |
- ");
-
- echo(" ");
-
- $sql = "SELECT * FROM interfaces WHERE `device_id` = '" . $device['device_id'] . "' AND deleted != '1'";
- $query = mysql_query($sql);
- while($data = mysql_fetch_array($query)) {
- $data = ifNameDescr($data);
- $data['hostname'] = $device['hostname'];
- echo("$ifsep" . generateiflink($data, makeshortif(strtolower($data['label']))));
- $ifsep = ", ";
- }
- unset($ifsep);
- echo(" ");
-
- echo(" ");
-
-}
+include("overview/ports.inc.php");
if($services['total']) {
diff --git a/html/pages/device/overview/cemp.inc.php b/html/pages/device/overview/cemp.inc.php
new file mode 100644
index 000000000..f2b8ef409
--- /dev/null
+++ b/html/pages/device/overview/cemp.inc.php
@@ -0,0 +1,41 @@
+");
+ echo("Memory Pools ");
+ echo("");
+ $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']);
+ $mempool['descr_fixed'] = str_replace("Sub-Module", "Mod", $mempool['descr_fixed']);
+ $mempool['descr_fixed'] = str_replace("DFC Card", "DFC", $mempool['descr_fixed']);
+
+ $proc_url = "?page=device/".$device['device_id']."/sensors/mempools/";
+
+ $mempool_popup = "onmouseover=\"return overlib('".$device['hostname']." - ".$mempool['descr_fixed'];
+ $mempool_popup .= " ";
+ $mempool_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
+
+
+ if($mempool['cpuCPMTotal5minRev'] > '60') { $mempool_colour='#cc0000'; } else { $mempool_colour='#0000cc'; }
+ echo("| " . $mempool['descr_fixed'] ." |
+  |
+ $perc% |
+ " . formatstorage($mempool['cempMemPoolFree'], 0) . "/" . formatstorage($mempool['cempMemPoolUsed'] + $mempool['cempMemPoolFree'], 0) . " |
+ ");
+ $i++;
+ }
+ echo(" ");
+ echo("");
+ $cemp = 1;
+}
+
+
+?>
diff --git a/html/pages/device/overview/cmp.inc.php b/html/pages/device/overview/cmp.inc.php
new file mode 100644
index 000000000..d7a3a5204
--- /dev/null
+++ b/html/pages/device/overview/cmp.inc.php
@@ -0,0 +1,38 @@
+");
+ echo("Memory Pools ");
+ echo("");
+ $i = '1';
+ $mempools = mysql_query("SELECT * FROM `cmpMemPool` WHERE device_id = '" . $device['device_id'] . "'");
+ while($mempool = mysql_fetch_array($mempools)) {
+ $perc = round($mempool['cmpUsed'] / ($mempool['cmpUsed'] + $mempool['cmpFree']) * 100,2);
+ $mempool['descr_fixed'] = $mempool['cmpName'];
+ $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']);
+ $mempool['descr_fixed'] = str_replace("Sub-Module", "Mod", $mempool['descr_fixed']);
+ $mempool['descr_fixed'] = str_replace("DFC Card", "DFC", $mempool['descr_fixed']);
+
+ $proc_url = "?page=device/".$device['device_id']."/sensors/mempools/";
+
+ $mempool_popup = "onmouseover=\"return overlib('".$device['hostname']." - ".$mempool['descr_fixed'];
+ $mempool_popup .= " ";
+ $mempool_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
+
+
+ if($mempool['cpuCPMTotal5minRev'] > '60') { $mempool_colour='#cc0000'; } else { $mempool_colour='#0000cc'; }
+ echo("| " . $mempool['descr_fixed'] ." |
+  |
+ $perc% |
+ " . formatstorage($mempool['cmpFree'], 0) . "/" . formatstorage($mempool['cmpUsed'] + $mempool['cmpFree'], 0) . " |
+ ");
+ $i++;
+ }
+ echo(" ");
+ echo("");
+}
+
+
+?>
diff --git a/html/pages/device/overview/cpmCPU.inc.php b/html/pages/device/overview/cpmCPU.inc.php
new file mode 100644
index 000000000..48f801e8d
--- /dev/null
+++ b/html/pages/device/overview/cpmCPU.inc.php
@@ -0,0 +1,27 @@
+");
+ echo("Processors ");
+ echo("");
+ $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']."/health/cpm/";
+ $proc_popup = "onmouseover=\"return overlib('".$device['hostname']." - ".$proc['entPhysicalDescr'];
+ $proc_popup .= " ";
+ $proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
+
+ if($proc['cpuCPMTotal5minRev'] > '60') { $proc_colour='#cc0000'; } else { $proc_colour='#0000cc'; }
+ echo("| " . $proc['entPhysicalDescr'] . " |
+  |
+ " . $proc['cpmCPUTotal5minRev'] . "% |
+ ");
+ $i++;
+ }
+ echo(" ");
+ echo("");
+}
+
+?>
diff --git a/html/pages/device/overview/hrProcessors.inc.php b/html/pages/device/overview/hrProcessors.inc.php
new file mode 100644
index 000000000..97b672ddc
--- /dev/null
+++ b/html/pages/device/overview/hrProcessors.inc.php
@@ -0,0 +1,33 @@
+");
+ echo("Processors ");
+ echo("");
+ $i = '1';
+ $procs = mysql_query("SELECT * FROM `hrDevice` WHERE device_id = '" . $device['device_id'] . "' AND hrDeviceType = 'hrDeviceProcessor'");
+ while($proc = mysql_fetch_array($procs)) {
+
+ $proc_url = "?page=device/".$device['device_id']."/health/hrprocessors/";
+
+ $proc_popup = "onmouseover=\"return overlib('".$device['hostname']." - ".$proc['entPhysicalDescr'];
+ $proc_popup .= " ";
+ $proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
+
+ $text_descr = short_hrDeviceDescr($proc['hrDeviceDescr']);
+
+ if($proc['hrProcessorLoad'] > '60') { $proc_colour='#cc0000'; } else { $proc_colour='#0000cc'; }
+ echo("| " . $text_descr . " |
+
+  |
+
+ " . $proc['hrProcessorLoad'] . "% |
+ ");
+ $i++;
+ }
+ echo(" ");
+ echo("");
+}
+
+?>
diff --git a/html/pages/device/overview/hrStorage.inc.php b/html/pages/device/overview/hrStorage.inc.php
new file mode 100644
index 000000000..c80a9c1c5
--- /dev/null
+++ b/html/pages/device/overview/hrStorage.inc.php
@@ -0,0 +1,39 @@
+");
+ echo("Storage ");
+ echo("");
+ $i = '1';
+
+ echo("| Mountpoint | Usage | | Total |
+ Used | ");
+ $drives = mysql_query("SELECT * FROM `storage` WHERE host_id = '" . $device['device_id'] . "'");
+ while($drive = mysql_fetch_array($drives)) {
+ $total = $drive['hrStorageSize'] * $drive['hrStorageAllocationUnits'];
+ $used = $drive['hrStorageUsed'] * $drive['hrStorageAllocationUnits'];
+ $drive['perc'] = round($drive['storage_perc'], 0);
+ $total = formatStorage($total);
+ $used = formatStorage($used);
+
+ $fs_url = "/device/".$device['device_id']."/health/storage/";
+
+ $fs_popup = "onmouseover=\"return overlib('".$device['hostname']." - ".$drive['hrStorageDescr'];
+ $fs_popup .= " ";
+ $fs_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
+
+ if($perc > '80') { $drv_colour='#cc0000'; } else { $drvclass='#0000cc'; }
+ echo("| " . $drive['hrStorageDescr'] . " |
+  |
+ " . $drive['perc'] . "% |
+ " . $total . " |
+ " . $used . " |
+ ");
+ $i++;
+ }
+ echo(" ");
+ echo("");
+}
+
+
+?>
diff --git a/html/pages/device/overview/ports.inc.php b/html/pages/device/overview/ports.inc.php
new file mode 100644
index 000000000..16600c73c
--- /dev/null
+++ b/html/pages/device/overview/ports.inc.php
@@ -0,0 +1,36 @@
+
+ Ports " . device_traffic_image($device['device_id'], 490, 100, $day, '-300s') . "");
+
+ echo("");
+
+echo("
+
+ |
+ $interfaces[total] |
+ $interfaces[up] |
+ $interfaces[down] |
+ $interfaces[disabled] |
+ ");
+
+ echo("");
+
+ $sql = "SELECT * FROM interfaces WHERE `device_id` = '" . $device['device_id'] . "' AND deleted != '1'";
+ $query = mysql_query($sql);
+ while($data = mysql_fetch_array($query)) {
+ $data = ifNameDescr($data);
+ $data['hostname'] = $device['hostname'];
+ echo("$ifsep" . generateiflink($data, makeshortif(strtolower($data['label']))));
+ $ifsep = ", ";
+ }
+ unset($ifsep);
+ echo(" ");
+
+ echo("");
+
+}
+
+
+?>
diff --git a/html/pages/device/overview/temperatures.inc.php b/html/pages/device/overview/temperatures.inc.php
new file mode 100644
index 000000000..180ab99c0
--- /dev/null
+++ b/html/pages/device/overview/temperatures.inc.php
@@ -0,0 +1,38 @@
+");
+ echo("Temperatures ");
+ $i = '1';
+ $temps = mysql_query("SELECT * FROM temperature WHERE temp_host = '" . $device['device_id'] . "'");
+ echo("");
+ echo("");
+ echo("");
+ while($temp = mysql_fetch_array($temps)) {
+ if(is_integer($i/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
+
+ $temp_perc = $temp['temp_current'] / $temp['temp_limit'] * 100;
+
+ $temp_colour = percent_colour($temp_perc);
+ $temp_url = "graph.php?id=" . $temp['temp_id'] . "&type=temp&from=$month&to=$now&width=400&height=125";
+ $temp_link = "";
+ $temp_link .= $temp['temp_descr'] . "";
+
+ $temp['temp_descr'] = truncate($temp['temp_descr'], 25, '');
+ echo("| $temp_link | " . $temp['temp_current'] . "°C | ");
+ if($i == $rows) { echo(" | "); }
+ $i++;
+ }
+ echo(" ");
+ echo(" | ");
+ echo(" ");
+ echo("");
+}
+
+
+?>
diff --git a/includes/functions.php b/includes/functions.php
index e067c4260..83e7e6432 100755
--- a/includes/functions.php
+++ b/includes/functions.php
@@ -316,7 +316,7 @@ function generatedevicelink($device, $text=0, $start=0, $end=0)
function device_traffic_image($device, $width, $height, $from, $to)
{
- return " ";
+ return " ";
}
function devclass($device)
diff --git a/includes/rewrites.php b/includes/rewrites.php
index 983123e84..85a39663e 100644
--- a/includes/rewrites.php
+++ b/includes/rewrites.php
@@ -184,6 +184,14 @@ $rewrite_ios_features = array(
'loop' => 'Loop',
);
+ $rewrite_hrDevice = array (
+ 'GenuineIntel:' => '',
+ 'AuthenticAMD:' => '',
+ 'Intel(R)' => '',
+ 'CPU' => '',
+ '(R)' => '',
+ ' ' => ' ',
+ );
// Specific rewrite functions
@@ -220,6 +228,15 @@ function fixifName ($inf)
return $inf;
}
+function short_hrDeviceDescr($dev)
+{
+ global $rewrite_hrDevice;
+ $dev = array_str_replace($rewrite_hrDevice, $dev);
+ $dev = preg_replace("/\ +/"," ", $dev);
+ $dev = trim($dev);
+ return $dev;
+}
+
function short_port_descr ($desc) {
list($desc) = explode("(", $desc);
|