ipmi sensors rewrite based on known hardware id

This commit is contained in:
crcro
2016-08-10 00:20:51 +03:00
parent 2c001db8ce
commit d5b499bae3
4 changed files with 30 additions and 9 deletions

View File

@@ -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']) {