mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
ipmi sensors rewrite based on known hardware id
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
<?php
|
||||
|
||||
|
||||
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 `sensor_type`, `sensor_index`+0, `sensor_oid`', array($sensor_class, $device['device_id']));
|
||||
}
|
||||
@@ -45,6 +43,8 @@ if (count($sensors)) {
|
||||
$link_array['page'] = 'graphs';
|
||||
unset($link_array['height'], $link_array['width'], $link_array['legend']);
|
||||
$link = generate_url($link_array);
|
||||
|
||||
$sensor['sensor_descr'] = truncate(ipmiSensorName($device['hardware'], $sensor['sensor_descr'], $ipmiSensorsNames), 48, '');
|
||||
|
||||
$overlib_content = '<div style="width: 580px;"><h2>'.$device['hostname'].' - '.$sensor['sensor_descr'].'</h1>';
|
||||
foreach (array('day', 'week', 'month', 'year') as $period) {
|
||||
@@ -61,7 +61,6 @@ if (count($sensors)) {
|
||||
$graph_array['from'] = $config['time']['day'];
|
||||
$sensor_minigraph = generate_lazy_graph_tag($graph_array);
|
||||
|
||||
$sensor['sensor_descr'] = truncate($sensor['sensor_descr'], 48, '');
|
||||
if (!empty($state_translation['0']['state_descr'])) {
|
||||
$state_style="";
|
||||
switch ($state_translation['0']['state_generic_value']) {
|
||||
|
Reference in New Issue
Block a user