diff --git a/html/includes/table/processor.inc.php b/html/includes/table/processor.inc.php
new file mode 100644
index 000000000..a7b3d9745
--- /dev/null
+++ b/html/includes/table/processor.inc.php
@@ -0,0 +1,67 @@
+ generate_device_link($processor),
+ 'processor_descr' => $processor['processor_descr'],
+ 'graph' => $mini_graph,
+ 'processor_usage' => $bar_link);
+ if ($_POST['view'] == "graphs") {
+ $graph_array['height'] = "100";
+ $graph_array['width'] = "216";
+ $graph_array['to'] = $config['time']['now'];
+ $graph_array['id'] = $processor['processor_id'];
+ $graph_array['type'] = $graph_type;
+ $return_data = true;
+ include("includes/print-graphrow.inc.php");
+ unset($return_data);
+ $response[] = array('hostname' => $graph_data[0],
+ 'processor_descr' => $graph_data[1],
+ 'graph' => $graph_data[2],
+ 'processor_usage' => $graph_data[3]);
+ } # endif graphs
+}
+$output = array('current'=>$current,'rowCount'=>$rowCount,'rows'=>$response,'total'=>$total);
+echo _json_encode($output);
diff --git a/html/pages/alert-log.inc.php b/html/pages/alert-log.inc.php
index 44eeb404c..34551e60b 100644
--- a/html/pages/alert-log.inc.php
+++ b/html/pages/alert-log.inc.php
@@ -24,7 +24,7 @@ $pagetitle[] = "Alert Log";
Time logged |
|
Device |
- alert |
+ Alert |
Status |
diff --git a/html/pages/health.inc.php b/html/pages/health.inc.php
index 50e1c1b58..6d4427fb3 100644
--- a/html/pages/health.inc.php
+++ b/html/pages/health.inc.php
@@ -9,7 +9,7 @@ if ($used_sensors['voltage']) $datas[] = 'voltage';
if ($used_sensors['frequency']) $datas[] = 'frequency';
if ($used_sensors['current']) $datas[] = 'current';
if ($used_sensors['power']) $datas[] = 'power';
-if ($used_sensors['dBm']) $datas[] = 'dBm';
+if ($used_sensors['dbm']) $datas[] = 'dbm';
// FIXME generalize -> static-config ?
$type_text['overview'] = "Overview";
@@ -17,7 +17,7 @@ $type_text['temperature'] = "Temperature";
$type_text['charge'] = "Battery Charge";
$type_text['humidity'] = "Humidity";
$type_text['mempool'] = "Memory";
-$type_text['storage'] = "Disk Usage";
+$type_text['storage'] = "Storage";
$type_text['diskio'] = "Disk I/O";
$type_text['processor'] = "Processor";
$type_text['voltage'] = "Voltage";
@@ -26,7 +26,7 @@ $type_text['frequency'] = "Frequency";
$type_text['current'] = "Current";
$type_text['power'] = "Power";
$type_text['toner'] = "Toner";
-$type_text['dBm'] = "dBm";
+$type_text['dbm'] = "dBm";
if (!$vars['metric']) { $vars['metric'] = "processor"; }
if (!$vars['view']) { $vars['view'] = "detail"; }
diff --git a/html/pages/health/processor.inc.php b/html/pages/health/processor.inc.php
index cf2cf461b..f0a39b717 100644
--- a/html/pages/health/processor.inc.php
+++ b/html/pages/health/processor.inc.php
@@ -1,83 +1,37 @@
-
+
+
+
+ | Device |
+ Processor |
+ |
+ Usage |
+
+
+
+
-$graph_type = "processor_usage";
-
-echo("");
-echo("
");
-
-echo("
- | Device |
- Processor |
- |
- Usage |
-
");
-
-foreach (dbFetchRows("SELECT * FROM `processors` AS P, `devices` AS D WHERE D.device_id = P.device_id ORDER BY D.hostname") as $proc)
-{
- if (device_permitted($proc['device_id']))
- {
- $device = $proc;
-
- // FIXME should that really be done here? :-)
- $text_descr = $proc['processor_descr'];
- $text_descr = str_replace("Routing Processor", "RP", $text_descr);
- $text_descr = str_replace("Switching Processor", "SP", $text_descr);
- $text_descr = str_replace("Sub-Module", "Module ", $text_descr);
- $text_descr = str_replace("DFC Card", "DFC", $text_descr);
-
- $proc_url = "device/device=".$device['device_id']."/tab=health/metric=processor/";
-
- $mini_url = "graph.php?id=".$proc['processor_id']."&type=".$graph_type."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=80&height=20&bg=f4f4f400";
-
- $proc_popup = "onmouseover=\"return overlib('".$device['hostname']." - ".$text_descr;
- $proc_popup .= "
";
- $proc_popup .= "', RIGHT".$config['overlib_defaults'].");\" onmouseout=\"return nd();\"";
-
- $perc = round($proc['processor_usage']);
-
- $background = get_percentage_colours($perc);
-
- echo("
- | ".generate_device_link($proc)." |
- " . $text_descr . " |
-  |
-
- ".print_percentage_bar (400, 20, $perc, $perc."%", "ffffff", $background['left'], (100 - $perc)."%" , "ffffff", $background['right']));
- echo(' |
-
');
-
- if ($vars['view'] == "graphs")
- {
- echo(' |
');
-
- $daily_graph = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=211&height=100";
- $daily_url = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=".$config['time']['day']."&to=".$config['time']['now']."&width=400&height=150";
-
- $weekly_graph = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=".$config['time']['week']."&to=".$config['time']['now']."&width=211&height=100";
- $weekly_url = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=".$config['time']['week']."&to=".$config['time']['now']."&width=400&height=150";
-
- $monthly_graph = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=".$config['time']['month']."&to=".$config['time']['now']."&width=211&height=100";
- $monthly_url = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=".$config['time']['month']."&to=".$config['time']['now']."&width=400&height=150";
-
- $yearly_graph = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=".$config['time']['year']."&to=".$config['time']['now']."&width=211&height=100";
- $yearly_url = "graph.php?id=" . $proc['processor_id'] . "&type=".$graph_type."&from=".$config['time']['year']."&to=".$config['time']['now']."&width=400&height=150";
-
- echo(" ', LEFT);\" onmouseout=\"return nd();\">
- ");
- echo(" ', LEFT);\" onmouseout=\"return nd();\">
- ");
- echo(" ', LEFT);\" onmouseout=\"return nd();\">
- ");
- echo(" ', LEFT);\" onmouseout=\"return nd();\">
- ");
- echo(" |
-
");
-
- } #end graphs if
- }
-}
-
-echo("
");
-echo("
");
-
-?>
+
diff --git a/html/pages/services.inc.php b/html/pages/services.inc.php
index baabceef9..8070d5d61 100644
--- a/html/pages/services.inc.php
+++ b/html/pages/services.inc.php
@@ -56,11 +56,17 @@ if ($_SESSION['userlevel'] >= '5')
$host_sql = "SELECT * FROM devices AS D, services AS S, devices_perms AS P WHERE D.device_id = S.device_id AND D.device_id = P.device_id AND P.user_id = ? GROUP BY D.hostname ORDER BY D.hostname";
$host_par = array($_SESSION['user_id']);
}
+ $shift = 1;
foreach (dbFetchRows($host_sql, $host_par) as $device)
{
$device_id = $device['device_id'];
$device_hostname = $device['hostname'];
- array_unshift($sql_param,$device_id);
+ if ($shift == 1) {
+ array_unshift($sql_param, $device_id);
+ $shift = 0;
+ } else {
+ $sql_param[0] = $device_id;
+ }
foreach (dbFetchRows("SELECT * FROM `services` WHERE `device_id` = ? $where", $sql_param) as $service)
{
include("includes/print-service.inc.php");
diff --git a/includes/discovery/storage/hrstorage.inc.php b/includes/discovery/storage/hrstorage.inc.php
index 6183658f8..397872941 100644
--- a/includes/discovery/storage/hrstorage.inc.php
+++ b/includes/discovery/storage/hrstorage.inc.php
@@ -9,6 +9,8 @@ if (is_array($hrstorage_array))
{
$fstype = $storage['hrStorageType'];
$descr = $storage['hrStorageDescr'];
+ $storage['hrStorageSize'] = fix_integer_value($storage['hrStorageSize']);
+ $storage['hrStorageUsed'] = fix_integer_value($storage['hrStorageUsed']);
$size = $storage['hrStorageSize'] * $storage['hrStorageAllocationUnits'];
$used = $storage['hrStorageUsed'] * $storage['hrStorageAllocationUnits'];
$units = $storage['hrStorageAllocationUnits'];
diff --git a/includes/functions.php b/includes/functions.php
index ef3cd98e3..1b995bfdb 100644
--- a/includes/functions.php
+++ b/includes/functions.php
@@ -1201,3 +1201,12 @@ function first_oid_match($device, $list) {
}
}
}
+
+function fix_integer_value($value) {
+ if ($value < 0) {
+ $return = 4294967296+$value;
+ } else {
+ $return = $value;
+ }
+ return $return;
+}
diff --git a/includes/polling/storage/hrstorage.inc.php b/includes/polling/storage/hrstorage.inc.php
index 304e61b7d..5ff95aa7b 100644
--- a/includes/polling/storage/hrstorage.inc.php
+++ b/includes/polling/storage/hrstorage.inc.php
@@ -11,8 +11,10 @@ if (!is_array($storage_cache['hrstorage']))
$entry = $storage_cache['hrstorage'][$storage[storage_index]];
$storage['units'] = $entry['hrStorageAllocationUnits'];
+$entry['hrStorageUsed'] = fix_integer_value($entry['hrStorageUsed']);
+$entry['hrStorageSize'] = fix_integer_value($entry['hrStorageSize']);
$storage['used'] = $entry['hrStorageUsed'] * $storage['units'];
$storage['size'] = $entry['hrStorageSize'] * $storage['units'];
$storage['free'] = $storage['size'] - $storage['used'];
-?>
\ No newline at end of file
+?>