Index: html/pages/device/health/status.inc.php
===================================================================
--- html/pages/device/health/status.inc.php (revision 0)
+++ html/pages/device/health/status.inc.php (revision 0)
@@ -0,0 +1,9 @@
+
Index: html/pages/device/overview/sensors/status.inc.php
===================================================================
--- html/pages/device/overview/sensors/status.inc.php (revision 0)
+++ html/pages/device/overview/sensors/status.inc.php (revision 0)
@@ -0,0 +1,10 @@
+
Index: html/pages/device/status.inc.php
===================================================================
--- html/pages/device/status.inc.php (revision 0)
+++ html/pages/device/status.inc.php (revision 0)
@@ -0,0 +1,86 @@
+ 'device',
+ 'device' => $device['device_id'],
+ 'tab' => 'status');
+
+if (!$vars['metric']) { $vars['metric'] = "overview"; }
+
+$navbar['brand'] = "Health";
+$navbar['class'] = "navbar-narrow";
+
+foreach ($datas as $type)
+{
+ if ($vars['metric'] == $type) { $navbar['options'][$type]['class'] = "active"; }
+ $navbar['options'][$type]['url'] = generate_url(array('page' => 'device', 'device' => $device['device_id'], 'tab' => 'status', 'metric' => $type));
+ $navbar['options'][$type]['text'] = $type_text[$type];
+}
+print_navbar($navbar);
+
+if (is_file("pages/device/status/".mres($vars['metric']).".inc.php"))
+{
+ include("pages/device/status/".mres($vars['metric']).".inc.php");
+} else {
+
+ echo('
');
+
+ foreach ($datas as $type)
+ {
+ if ($type != "overview")
+ {
+
+ $graph_title = $type_text[$type];
+ $graph_array['type'] = "device_".$type;
+
+ include("includes/print-device-graph.php");
+ }
+ }
+ echo('
');
+}
+
+$pagetitle[] = "Health";
+
+?>
Index: html/pages/device/health.inc.php
===================================================================
--- html/pages/device/health.inc.php (revision 4037)
+++ html/pages/device/health.inc.php (working copy)
@@ -13,6 +13,7 @@
$freqs = dbFetchCell("select count(*) from sensors WHERE sensor_class='frequency' AND device_id = ?", array($device['device_id']));
$power = dbFetchCell("select count(*) from sensors WHERE sensor_class='power' AND device_id = ?", array($device['device_id']));
$dBm = dbFetchCell("select count(*) from sensors WHERE sensor_class='dBm' AND device_id = ?", array($device['device_id']));
+$status = dbFetchCell("select count(*) from sensors WHERE sensor_class='status' AND device_id = ?", array($device['device_id']));
unset($datas);
$datas[] = 'overview';
@@ -28,6 +29,7 @@
if ($current) { $datas[] = 'current'; }
if ($power) { $datas[] = 'power'; }
if ($dBm) { $datas[] = 'dbm'; }
+if ($status) { $datas[] = 'status'; }
$type_text['overview'] = "Overview";
$type_text['temperature'] = "Temperature";
@@ -42,6 +44,7 @@
$type_text['current'] = "Current";
$type_text['power'] = "Power";
$type_text['dbm'] = "dBm";
+$type_text['status'] = "Status";
$link_array = array('page' => 'device',
'device' => $device['device_id'],
Index: html/pages/device/overview.inc.php
===================================================================
--- html/pages/device/overview.inc.php (revision 4037)
+++ html/pages/device/overview.inc.php (working copy)
@@ -106,6 +106,7 @@
include("overview/sensors/current.inc.php");
include("overview/sensors/power.inc.php");
include("overview/sensors/frequencies.inc.php");
+include("overview/sensors/status.inc.php");
// Start events
?>
Index: html/pages/health/status.inc.php
===================================================================
--- html/pages/health/status.inc.php (revision 0)
+++ html/pages/health/status.inc.php (revision 0)
@@ -0,0 +1,10 @@
+
Index: html/pages/health.inc.php
===================================================================
--- html/pages/health.inc.php (revision 4037)
+++ html/pages/health.inc.php (working copy)
@@ -9,6 +9,7 @@
if ($used_sensors['current']) $datas[] = 'current';
if ($used_sensors['power']) $datas[] = 'power';
if ($used_sensors['dBm']) $datas[] = 'dBm';
+if ($used_sensors['status']) $datas[] = 'status';
// FIXME generalize -> static-config ?
$type_text['overview'] = "Overview";
@@ -25,6 +26,7 @@
$type_text['power'] = "Power";
$type_text['toner'] = "Toner";
$type_text['dBm'] = "dBm";
+$type_text['status'] = "Status";
if (!$vars['metric']) { $vars['metric'] = "processor"; }
if (!$vars['view']) { $vars['view'] = "detail"; }
Index: html/includes/graphs/sensor/status.inc.php
===================================================================
--- html/includes/graphs/sensor/status.inc.php (revision 0)
+++ html/includes/graphs/sensor/status.inc.php (revision 0)
@@ -0,0 +1,17 @@
+
Index: includes/polling/unix-agent/hdarray.inc.php
===================================================================
--- includes/polling/unix-agent/hdarray.inc.php (revision 0)
+++ includes/polling/unix-agent/hdarray.inc.php (revision 0)
@@ -0,0 +1,35 @@
+ "$param: $status", 'current' => $istatus, 'index' => $itemcount);
+ }
+ if (preg_match("/^Drive/","$param")) {
+ discover_sensor($valid['sensor'], 'status', $device, '', $itemcount, 'state', "$param: $status", '1', '1', 1, NULL, 1, NULL, $istatus, 'agent');
+ $agent_sensors['status']['state'][$itemcount] = array('description' => "$param: $status", 'current' => $istatus, 'index' => $itemcount);
+ }
+ }
+ echo "\n";
+ }
+}
+
+?>