mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
run rename only for ipmi type sensors, added the power usage sensors, updated rewrite for known hosts
This commit is contained in:
@@ -14,8 +14,13 @@ $rrd_options .= " DEF:sensor_min=$rrd_filename:sensor:MIN";
|
||||
$rrd_options .= ' AREA:sensor_max#c5c5c5';
|
||||
$rrd_options .= ' AREA:sensor_min#ffffffff';
|
||||
|
||||
// $rrd_options .= " AREA:sensor#FFFF99";
|
||||
$rrd_options .= " LINE1.5:sensor#cc0000:'".rrdtool_escape($sensor['sensor_descr'], 22)."'";
|
||||
if($sensor['poller_type'] == "ipmi")
|
||||
{
|
||||
$rrd_options .= " LINE1.5:sensor#cc0000:'".rrdtool_escape(ipmiSensorName($device['hardware'], $sensor['sensor_descr'], $ipmiSensorsNames), 21)."'";
|
||||
} else {
|
||||
$rrd_options .= " LINE1.5:sensor#cc0000:'".rrdtool_escape($sensor['sensor_descr'], 21)."'";
|
||||
}
|
||||
|
||||
$rrd_options .= ' GPRINT:sensor:LAST:%6.2lfW';
|
||||
$rrd_options .= ' GPRINT:sensor:MAX:%6.2lfW\\\\l';
|
||||
|
||||
|
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
$scale_min = '0';
|
||||
$scale_max = '60';
|
||||
|
||||
@@ -16,7 +15,13 @@ $rrd_options .= ' CDEF:sensor_diff=sensor_max,sensor_min,-';
|
||||
$rrd_options .= ' AREA:sensor_min';
|
||||
$rrd_options .= ' AREA:sensor_diff#c5c5c5::STACK';
|
||||
|
||||
$rrd_options .= " LINE1.5:sensor#cc0000:'".rrdtool_escape(ipmiSensorName($device['hardware'], $sensor['sensor_descr'], $ipmiSensorsNames), 21)."'"
|
||||
if($sensor['poller_type'] == "ipmi")
|
||||
{
|
||||
$rrd_options .= " LINE1.5:sensor#cc0000:'".rrdtool_escape(ipmiSensorName($device['hardware'], $sensor['sensor_descr'], $ipmiSensorsNames), 21)."'";
|
||||
} else {
|
||||
$rrd_options .= " LINE1.5:sensor#cc0000:'".rrdtool_escape($sensor['sensor_descr'], 21)."'";
|
||||
}
|
||||
|
||||
$rrd_options .= ' GPRINT:sensor_min:MIN:%4.1lfC';
|
||||
$rrd_options .= ' GPRINT:sensor:LAST:%4.1lfC';
|
||||
$rrd_options .= ' GPRINT:sensor_max:MAX:%4.1lfC\\l';
|
||||
@@ -28,3 +33,4 @@ if (is_numeric($sensor['sensor_limit'])) {
|
||||
if (is_numeric($sensor['sensor_limit_low'])) {
|
||||
$rrd_options .= ' HRULE:'.$sensor['sensor_limit_low'].'#999999::dashes';
|
||||
}
|
||||
|
||||
|
@@ -9,7 +9,14 @@ foreach (dbFetchRows('SELECT * FROM `sensors` WHERE `sensor_class` = ? AND `devi
|
||||
else {
|
||||
$row_colour = $list_colour_b;
|
||||
}
|
||||
$sensor_descr = ipmiSensorName($device['hardware'], $sensor['sensor_descr'], $ipmiSensorsNames);
|
||||
|
||||
if($sensor['poller_type'] == "ipmi")
|
||||
{
|
||||
$sensor_descr = ipmiSensorName($device['hardware'], $sensor['sensor_descr'], $ipmiSensorsNames);
|
||||
} else {
|
||||
$sensor_descr = $sensor['sensor_descr'];
|
||||
}
|
||||
|
||||
$sensor_current = format_si($sensor['sensor_current']).$unit;
|
||||
$sensor_limit = format_si($sensor['sensor_limit']).$unit;
|
||||
$sensor_limit_low = format_si($sensor['sensor_limit_low']).$unit;
|
||||
|
@@ -44,7 +44,12 @@ if (count($sensors)) {
|
||||
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, '');
|
||||
if($sensor['poller_type'] == "ipmi")
|
||||
{
|
||||
$sensor['sensor_descr'] = truncate(ipmiSensorName($device['hardware'], $sensor['sensor_descr'], $ipmiSensorsNames), 48, '');
|
||||
} else {
|
||||
$sensor['sensor_descr'] = truncate($sensor['sensor_descr'], 48, '');
|
||||
}
|
||||
|
||||
$overlib_content = '<div style="width: 580px;"><h2>'.$device['hostname'].' - '.$sensor['sensor_descr'].'</h1>';
|
||||
foreach (array('day', 'week', 'month', 'year') as $period) {
|
||||
|
@@ -1344,6 +1344,7 @@ $ipmiSensorsNames = array(
|
||||
"Temp 8" => "System zone",
|
||||
"Temp 9" => "System zone",
|
||||
"Temp 10" => "Storage zone",
|
||||
"Power Meter" => "Power usage",
|
||||
),
|
||||
"HP ProLiant BL460c G1" => array(
|
||||
"Temp 1" => "System zone",
|
||||
@@ -1355,5 +1356,6 @@ $ipmiSensorsNames = array(
|
||||
"Temp 7" => "CPU 2",
|
||||
"Temp 8" => "Memory zone",
|
||||
"Temp 9" => "Ambient zone",
|
||||
"Power Meter" => "Power usage",
|
||||
),
|
||||
);
|
||||
|
Reference in New Issue
Block a user