mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
A few things
ucwords = happy ocd Basic state page Allign order = happy ocd
This commit is contained in:
@@ -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)) {
|
||||
|
@@ -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";
|
||||
|
7
html/pages/health/state.inc.php
Normal file
7
html/pages/health/state.inc.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
$graph_type = 'sensor_state';
|
||||
$unit = '';
|
||||
$class = 'state';
|
||||
|
||||
require 'pages/health/sensors.inc.php';
|
@@ -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);
|
||||
|
Reference in New Issue
Block a user