A few things

ucwords = happy ocd

Basic state page

Allign order = happy ocd
This commit is contained in:
Rosiak
2016-02-27 02:35:28 +01:00
parent ebe9154934
commit 6923a32dbd
4 changed files with 12 additions and 2 deletions

View File

@@ -3,7 +3,7 @@
$sensors = dbFetchRows('SELECT * FROM `sensors` WHERE `sensor_class` = ? AND device_id = ? ORDER BY `poller_type`, `sensor_oid`, `sensor_index`', array($sensor_class, $device['device_id']));
if ($sensor_class == 'state') {
$sensors = dbFetchRows('SELECT * FROM `sensors` LEFT JOIN `sensors_to_state_indexes` ON sensors_to_state_indexes.sensor_id = sensors.sensor_id LEFT JOIN state_indexes ON state_indexes.state_index_id = sensors_to_state_indexes.state_index_id WHERE `sensor_class` = ? AND device_id = ? ORDER BY `poller_type`, `sensor_descr` ', array($sensor_class, $device['device_id']));
$sensors = dbFetchRows('SELECT * FROM `sensors` LEFT JOIN `sensors_to_state_indexes` ON sensors_to_state_indexes.sensor_id = sensors.sensor_id LEFT JOIN state_indexes ON state_indexes.state_index_id = sensors_to_state_indexes.state_index_id WHERE `sensor_class` = ? AND device_id = ? ORDER BY `poller_type`, `sensor_oid`, `sensor_index`', array($sensor_class, $device['device_id']));
}
if (count($sensors)) {

View File

@@ -11,6 +11,7 @@ if ($used_sensors['current']) $datas[] = 'current';
if ($used_sensors['power']) $datas[] = 'power';
if ($used_sensors['dbm']) $datas[] = 'dbm';
if ($used_sensors['load']) $datas[] = 'load';
if ($used_sensors['state']) $datas[] = 'state';
// FIXME generalize -> static-config ?
$type_text['overview'] = "Overview";
@@ -29,6 +30,7 @@ $type_text['power'] = "Power";
$type_text['toner'] = "Toner";
$type_text['dbm'] = "dBm";
$type_text['load'] = "Load";
$type_text['state'] = "State";
if (!$vars['metric']) {
$vars['metric'] = "processor";

View File

@@ -0,0 +1,7 @@
<?php
$graph_type = 'sensor_state';
$unit = '';
$class = 'state';
require 'pages/health/sensors.inc.php';

View File

@@ -53,7 +53,8 @@ if ($device['os_group'] == 'cisco') {
foreach ($temp as $index => $entry) {
//Discover Sensors
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, $temp[$index][$tablevalue[3]], '1', '1', null, null, null, null, $temp[$index][$tablevalue[2]], 'snmp', $index);
$descr = ucwords($temp[$index][$tablevalue[3]]);
discover_sensor($valid['sensor'], 'state', $device, $cur_oid.$index, $index, $state_name, $descr, '1', '1', null, null, null, null, $temp[$index][$tablevalue[2]], 'snmp', $index);
//Create Sensor To State Index
create_sensor_to_state_index($device, $state_name, $index);