diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php
index 088e0444b..4673db15f 100644
--- a/html/includes/functions.inc.php
+++ b/html/includes/functions.inc.php
@@ -1,5 +1,14 @@
+
+
".$left_text."
+
".$right_text."
";
+ return $output;
+}
+
+
function generate_if_link($args)
{
global $twoday; global $now; global $config; global $day; global $month;
diff --git a/html/pages/device/health.inc.php b/html/pages/device/health.inc.php
index 564397d11..bd8ba97e9 100644
--- a/html/pages/device/health.inc.php
+++ b/html/pages/device/health.inc.php
@@ -4,7 +4,6 @@ $temp = mysql_result(mysql_query("select count(*) from temperature WHERE device_
$storage = mysql_result(mysql_query("select count(*) from storage WHERE host_id = '" . $device['device_id'] . "'"), 0);
$cemp = mysql_result(mysql_query("select count(*) from cempMemPool WHERE device_id = '" . $device['device_id'] . "'"), 0);
$cmp = mysql_result(mysql_query("select count(*) from cmpMemPool WHERE device_id = '" . $device['device_id'] . "'"), 0);
-$cpm = mysql_result(mysql_query("select count(*) from cpmCPU WHERE device_id = '" . $device['device_id'] . "'"), 0);
$hrprocessor = mysql_result(mysql_query("select count(*) from hrDevice WHERE device_id = '" . $device['device_id'] . "' AND `hrDeviceType` = 'hrDeviceProcessor'"), 0);
$processor = mysql_result(mysql_query("select count(*) from processors WHERE device_id = '" . $device['device_id'] . "'"), 0);
$fans = mysql_result(mysql_query("select count(*) from fanspeed WHERE device_id = '" . $device['device_id'] . "'"), 0);
@@ -13,7 +12,6 @@ $volts = mysql_result(mysql_query("select count(*) from voltage WHERE device_id
if ($temp) { $datas[] = 'temp'; }
if ($storage) { $datas[] = 'storage'; }
if ($cemp) { $datas[] = 'cemp'; }
-if ($cpm) { $datas[] = 'cpm'; }
if ($cmp) { $datas[] = 'cmp'; }
if ($hrprocessor) { $datas[] = 'hrprocessors'; }
if ($processor) { $datas[] = 'processors'; }
@@ -23,7 +21,6 @@ if ($volts) { $datas[] = 'voltages'; }
$type_text['temp'] = "Temperatures";
$type_text['cmp'] = "Memory Pools";
$type_text['cemp'] = "Memory Enh Pools";
-$type_text['cpm'] = "Processor Usage";
$type_text['storage'] = "Disk Usage";
$type_text['hrprocessors'] = "Processor Usage";
$type_text['processors'] = "Processor Usage";
diff --git a/html/pages/device/health/cpm.inc.php b/html/pages/device/health/cpm.inc.php
deleted file mode 100644
index 8c993c751..000000000
--- a/html/pages/device/health/cpm.inc.php
+++ /dev/null
@@ -1,52 +0,0 @@
-");
- echo("");
- echo("");
-
-
-?>
diff --git a/html/pages/device/overview.inc.php b/html/pages/device/overview.inc.php
index 2772cfdef..c7101d8cc 100644
--- a/html/pages/device/overview.inc.php
+++ b/html/pages/device/overview.inc.php
@@ -46,8 +46,6 @@ echo("
$services[disabled] |
");
-
-
echo("");
$sql = "SELECT * FROM services WHERE service_host = '" . $device['device_id'] . "' ORDER BY service_type";
@@ -63,6 +61,8 @@ echo("
echo("
");
+ echo("");
+
}
echo("");
@@ -72,7 +72,6 @@ echo("");
### Right Pane
include("overview/processors.inc.php");
-include("overview/hrProcessors.inc.php");
include("overview/cemp.inc.php");
include("overview/cmp.inc.php");
include("overview/hrStorage.inc.php");
diff --git a/html/pages/device/overview/hrStorage.inc.php b/html/pages/device/overview/hrStorage.inc.php
index b17b8e1ba..fee344de4 100644
--- a/html/pages/device/overview/hrStorage.inc.php
+++ b/html/pages/device/overview/hrStorage.inc.php
@@ -3,16 +3,15 @@
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("");
+ $drive_rows = '0';
- echo("| Mountpoint | Usage | | Total |
- Used |
");
$drives = mysql_query("SELECT * FROM `storage` WHERE host_id = '" . $device['device_id'] . "'");
while($drive = mysql_fetch_array($drives)) {
+ if(is_integer($drive_rows/2)) { $row_colour = $list_colour_a; } else { $row_colour = $list_colour_b; }
$total = $drive['hrStorageSize'] * $drive['hrStorageAllocationUnits'];
$used = $drive['hrStorageUsed'] * $drive['hrStorageAllocationUnits'];
- $drive['perc'] = round($drive['storage_perc'], 0);
+ $perc = round($drive['storage_perc'], 0);
$total = formatStorage($total);
$used = formatStorage($used);
@@ -22,18 +21,26 @@ if(mysql_result(mysql_query("SELECT count(storage_id) from storage WHERE host_id
$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 . " |
+ $mini_graph = $config['base_url'] . "/graph.php?id=".$drive['storage_id']."&type=hrstorage&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4";
+
+
+
+ if($perc > '90') { $left_background='c4323f'; $right_background='C96A73';
+ } elseif($perc > '75') { $left_background='bf5d5b'; $right_background='d39392';
+ } elseif($perc > '50') { $left_background='bf875b'; $right_background='d3ae92';
+ } elseif($perc > '25') { $left_background='5b93bf'; $right_background='92b7d3';
+ } else { $left_background='9abf5b'; $right_background='bbd392'; }
+
+ echo("
| " . $drive['hrStorageDescr'] . " |
+  |
+ ".print_percentage_bar (200, 16, $perc, "$used / $total", "ffffff", $left_background, $perc . "%", "ffffff", $right_background)." |
");
- $i++;
+ $drive_rows++;
}
echo("
");
echo("");
}
+unset ($drive_rows);
?>
diff --git a/html/pages/device/overview/processors.inc.php b/html/pages/device/overview/processors.inc.php
index 66f969e7b..c63a7b96e 100644
--- a/html/pages/device/overview/processors.inc.php
+++ b/html/pages/device/overview/processors.inc.php
@@ -19,15 +19,22 @@ if(mysql_result(mysql_query("SELECT count(*) from processors WHERE device_id = '
$mini_url = $config['base_url'] . "/graph.php?id=".$proc['processor_id']."&type=processor&from=".$day."&to=".$now."&width=80&height=20&bg=f4f4f4";
$text_descr = $proc['processor_descr'];
-# $text_descr = short_processor_descr($proc['processor_descr']);
+ $text_descr = short_hrDeviceDescr($proc['processor_descr']);
- if($proc['processor_usage'] > '60') { $proc_colour='#cc0000'; } else { $proc_colour='#0000cc'; }
- echo("| " . $text_descr . " |
-  |
-
-  |
-
- " . $proc['processor_usage'] . "% |
+ $perc = $proc['processor_usage'];
+
+ if($perc > '90') { $left_background='c4323f'; $right_background='C96A73';
+ } elseif($perc > '75') { $left_background='bf5d5b'; $right_background='d39392';
+ } elseif($perc > '50') { $left_background='bf875b'; $right_background='d3ae92';
+ } elseif($perc > '25') { $left_background='5b93bf'; $right_background='92b7d3';
+ } else { $left_background='9abf5b'; $right_background='bbd392'; }
+
+
+ echo("
| " . $text_descr . " |
+  |
+
+ ".print_percentage_bar (200, 16, $perc, NULL, "ffffff", $left_background, $perc . "%", "ffffff", $right_background)."
+ |
");
$processor_rows++;
}
diff --git a/includes/discovery/processors.inc.php b/includes/discovery/processors.inc.php
index 981423f6c..bfc2e61a1 100755
--- a/includes/discovery/processors.inc.php
+++ b/includes/discovery/processors.inc.php
@@ -4,6 +4,7 @@ echo("Processors : ");
include("processors-ios.inc.php");
include("processors-junose.inc.php");
+include("processors-hrdevice.inc.php");
### Remove processors which weren't redetected here
diff --git a/includes/discovery/storage.php b/includes/discovery/storage.php
index bac38bb50..15d2f8b86 100755
--- a/includes/discovery/storage.php
+++ b/includes/discovery/storage.php
@@ -23,6 +23,7 @@
if (isset($config['ignore_mount_network']) && $config['ignore_mount_network'] && $fstype == "hrStorageNetworkDisk") { $allow = 0; if ($debug) echo("network, skipping\n"); }
$descr = str_replace("mounted on: ", "", $descr);
$descr = preg_replace("/: [A-Za-z0-9_]+ file system, /", ", ", $descr);
+ echo("$fstype");
if($size > '0' && $allow) {
if(mysql_result(mysql_query("SELECT count(storage_id) FROM `storage` WHERE hrStorageIndex = '$hrStorageIndex' AND host_id = '".$device['device_id']."'"),0) == '0') {
@@ -32,10 +33,12 @@
echo("+");
} else {
$data = mysql_fetch_array(mysql_query("SELECT * FROM `storage` WHERE hrStorageIndex = '$hrStorageIndex' AND host_id = '".$device['device_id']."'"));
- if($data['hrStorageDescr'] != $descr || $data['hrStorageSize'] != $size || $data['hrStorageAllocationUnits'] != $units ) {
+ if($data['hrStorageDescr'] != $descr || $data['hrStorageSize'] != $size || $data['hrStorageAllocationUnits'] != $units || $data['hrStorageType'] != $fstype) {
$query = "UPDATE storage SET `hrStorageDescr` = '$descr', `hrStorageType` = '$fstype', `hrStorageSize` = '$size', `hrStorageAllocationUnits` = '$units' ";
+ $query .= ", `hrStorageType` = '$fstype' ";
$query .= "WHERE hrStorageIndex = '$hrStorageIndex' AND host_id = '".$device['device_id']."'";
echo("U");
+ if($debug) { echo("$query \n"); }
mysql_query($query);
} else { echo("."); }
}
diff --git a/includes/polling/hr-mib.inc.php b/includes/polling/hr-mib.inc.php
index 503995838..ea2c1916c 100755
--- a/includes/polling/hr-mib.inc.php
+++ b/includes/polling/hr-mib.inc.php
@@ -34,6 +34,6 @@ if (!is_file($hrSystem_rrd)) {
rrdtool_update($hrSystem_rrd, "N:$hrSystemNumUsers:$hrSystemProcesses:$uptime");
include("hr-mib_storage.inc.php"); // Run HOST-RESOURCES-MIB Storage
-include("hr-mib_processor.inc.php"); // Run HOST-RESOURCES-MIB ProcessorLoad
+#include("hr-mib_processor.inc.php"); // Run HOST-RESOURCES-MIB ProcessorLoad
?>