mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
newdevice: Added sensor detection for APC In Row RD devices (#7385)
* newdevice: Added sensor detection for APC In Row RD devices * Update apc.yaml * Update apc.yaml * Update cooling.inc.php * Update pressure.inc.php
This commit is contained in:
@@ -10,6 +10,7 @@ Currently we have support for the following health metrics along with the values
|
||||
| ------------------------------- | --------------------------- |
|
||||
| airflow | cfm |
|
||||
| charge | % |
|
||||
| cooling | W |
|
||||
| current | A |
|
||||
| dbm | dBm |
|
||||
| fanspeed | rpm |
|
||||
@@ -17,6 +18,7 @@ Currently we have support for the following health metrics along with the values
|
||||
| humidity | % |
|
||||
| load | % |
|
||||
| power | W |
|
||||
| pressure | kPa |
|
||||
| runtime | Min |
|
||||
| signal | dBm |
|
||||
| snr | SNR |
|
||||
|
7
html/includes/graphs/device/cooling.inc.php
Normal file
7
html/includes/graphs/device/cooling.inc.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
$class = 'cooling';
|
||||
$unit = '';
|
||||
$unit_long = 'W';
|
||||
|
||||
require 'includes/graphs/device/sensor.inc.php';
|
7
html/includes/graphs/device/pressure.inc.php
Normal file
7
html/includes/graphs/device/pressure.inc.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
$class = 'pressure';
|
||||
$unit = '';
|
||||
$unit_long = 'kPa';
|
||||
|
||||
require 'includes/graphs/device/sensor.inc.php';
|
20
html/includes/graphs/sensor/cooling.inc.php
Normal file
20
html/includes/graphs/sensor/cooling.inc.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
$scale_min = '0';
|
||||
|
||||
require 'includes/graphs/common.inc.php';
|
||||
|
||||
$rrd_options .= " COMMENT:' Last Max\\n'";
|
||||
|
||||
$rrd_options .= " DEF:sensor=$rrd_filename:sensor:AVERAGE";
|
||||
$rrd_options .= " LINE1.5:sensor#cc0000:'".rrdtool_escape($sensor['sensor_descr'], 20)."'";
|
||||
$rrd_options .= ' GPRINT:sensor:LAST:%3.0lfW';
|
||||
$rrd_options .= ' GPRINT:sensor:MAX:%3.0lfW\l';
|
||||
|
||||
if (is_numeric($sensor['sensor_limit'])) {
|
||||
$rrd_options .= ' HRULE:'.$sensor['sensor_limit'].'#999999::dashes';
|
||||
}
|
||||
|
||||
if (is_numeric($sensor['sensor_limit_low'])) {
|
||||
$rrd_options .= ' HRULE:'.$sensor['sensor_limit_low'].'#999999::dashes';
|
||||
}
|
20
html/includes/graphs/sensor/pressure.inc.php
Normal file
20
html/includes/graphs/sensor/pressure.inc.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
$scale_min = '0';
|
||||
|
||||
require 'includes/graphs/common.inc.php';
|
||||
|
||||
$rrd_options .= " COMMENT:' Last Max\\n'";
|
||||
|
||||
$rrd_options .= " DEF:sensor=$rrd_filename:sensor:AVERAGE";
|
||||
$rrd_options .= " LINE1.5:sensor#cc0000:'".rrdtool_escape($sensor['sensor_descr'], 20)."'";
|
||||
$rrd_options .= ' GPRINT:sensor:LAST:%3.0lfkPa';
|
||||
$rrd_options .= ' GPRINT:sensor:MAX:%3.0lfkPa\l';
|
||||
|
||||
if (is_numeric($sensor['sensor_limit'])) {
|
||||
$rrd_options .= ' HRULE:'.$sensor['sensor_limit'].'#999999::dashes';
|
||||
}
|
||||
|
||||
if (is_numeric($sensor['sensor_limit_low'])) {
|
||||
$rrd_options .= ' HRULE:'.$sensor['sensor_limit_low'].'#999999::dashes';
|
||||
}
|
@@ -374,7 +374,25 @@ if ($menu_sensors) {
|
||||
echo(' <li role="presentation" class="divider"></li>');
|
||||
}
|
||||
|
||||
$icons = array('fanspeed'=>'tachometer','humidity'=>'tint','temperature'=>'thermometer-full','current'=>'bolt','frequency'=>'line-chart','power'=>'power-off','voltage'=>'bolt','charge'=>'battery-half','dbm'=>'sun-o', 'load'=>'percent', 'runtime' => 'hourglass-half', 'state'=>'bullseye','signal'=>'wifi', 'snr'=>'signal');
|
||||
$icons = array(
|
||||
'fanspeed' => 'tachometer',
|
||||
'humidity' => 'tint',
|
||||
'temperature' => 'thermometer-full',
|
||||
'current' => 'bolt',
|
||||
'frequency' => 'line-chart',
|
||||
'power' => 'power-off',
|
||||
'voltage' => 'bolt',
|
||||
'charge' => 'battery-half',
|
||||
'dbm' => 'sun-o',
|
||||
'load' => 'percent',
|
||||
'runtime' => 'hourglass-half',
|
||||
'state' => 'bullseye',
|
||||
'signal' => 'wifi',
|
||||
'snr' => 'signal',
|
||||
'pressure' => 'thermometer-empty',
|
||||
'cooling' => 'thermometer-full',
|
||||
'airflow' => 'angle-double-right',
|
||||
);
|
||||
foreach (array('fanspeed','humidity','temperature','signal') as $item) {
|
||||
if (isset($menu_sensors[$item])) {
|
||||
echo(' <li><a href="health/metric='.$item.'/"><i class="fa fa-'.$icons[$item].' fa-fw fa-lg" aria-hidden="true"></i> '.nicecase($item).'</a></li>');
|
||||
|
@@ -20,6 +20,8 @@ $load = dbFetchCell("select count(*) from sensors WHERE sensor_class='lo
|
||||
$signal = dbFetchCell("select count(*) from sensors WHERE sensor_class='signal' AND device_id = ?", array($device['device_id']));
|
||||
$airflow = dbFetchCell("select count(*) from sensors WHERE sensor_class='airflow' AND device_id = ?", array($device['device_id']));
|
||||
$snr = dbFetchCell("select count(*) from sensors WHERE sensor_class='snr' AND device_id = ?", array($device['device_id']));
|
||||
$pressure = dbFetchCell("select count(*) from sensors WHERE sensor_class='pressure' AND device_id = ?", array($device['device_id']));
|
||||
$cooling = dbFetchCell("select count(*) from sensors WHERE sensor_class='cooling' AND device_id = ?", array($device['device_id']));
|
||||
|
||||
unset($datas);
|
||||
$datas[] = 'overview';
|
||||
@@ -99,6 +101,14 @@ if ($snr) {
|
||||
$datas[] = 'snr';
|
||||
}
|
||||
|
||||
if ($pressure) {
|
||||
$datas[] = 'pressure';
|
||||
}
|
||||
|
||||
if ($cooling) {
|
||||
$datas[] = 'cooling';
|
||||
}
|
||||
|
||||
$type_text['overview'] = 'Overview';
|
||||
$type_text['charge'] = 'Battery Charge';
|
||||
$type_text['temperature'] = 'Temperature';
|
||||
@@ -119,6 +129,8 @@ $type_text['load'] = 'Load';
|
||||
$type_text['signal'] = 'Signal';
|
||||
$type_text['airflow'] = 'Airflow';
|
||||
$type_text['snr'] = 'SNR';
|
||||
$type_text['pressure'] = 'Pressure';
|
||||
$type_text['cooling'] = 'Cooling';
|
||||
|
||||
$link_array = array(
|
||||
'page' => 'device',
|
||||
|
7
html/pages/device/health/cooling.inc.php
Normal file
7
html/pages/device/health/cooling.inc.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
$class = 'cooling';
|
||||
$unit = 'W';
|
||||
$graph_type = 'sensor_cooling';
|
||||
|
||||
require 'sensors.inc.php';
|
7
html/pages/device/health/pressure.inc.php
Normal file
7
html/pages/device/health/pressure.inc.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
$class = 'pressure';
|
||||
$unit = 'kPa';
|
||||
$graph_type = 'sensor_pressure';
|
||||
|
||||
require 'sensors.inc.php';
|
@@ -70,6 +70,8 @@ require 'overview/sensors/state.inc.php';
|
||||
require 'overview/sensors/signal.inc.php';
|
||||
require 'overview/sensors/airflow.inc.php';
|
||||
require 'overview/sensors/snr.inc.php';
|
||||
require 'overview/sensors/pressure.inc.php';
|
||||
require 'overview/sensors/cooling.inc.php';
|
||||
require 'overview/eventlog.inc.php';
|
||||
require 'overview/services.inc.php';
|
||||
require 'overview/syslog.inc.php';
|
||||
|
8
html/pages/device/overview/sensors/cooling.inc.php
Normal file
8
html/pages/device/overview/sensors/cooling.inc.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
$graph_type = 'sensor_cooling';
|
||||
$sensor_class = 'cooling';
|
||||
$sensor_unit = 'W';
|
||||
$sensor_type = 'Cooling';
|
||||
|
||||
require 'pages/device/overview/generic/sensor.inc.php';
|
8
html/pages/device/overview/sensors/pressure.inc.php
Normal file
8
html/pages/device/overview/sensors/pressure.inc.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
$graph_type = 'sensor_pressure';
|
||||
$sensor_class = 'pressure';
|
||||
$sensor_unit = 'kPa';
|
||||
$sensor_type = 'Pressure';
|
||||
|
||||
require 'pages/device/overview/generic/sensor.inc.php';
|
@@ -43,6 +43,12 @@ if ($used_sensors['signal']) {
|
||||
if ($used_sensors['snr']) {
|
||||
$datas[] = 'snr';
|
||||
}
|
||||
if ($used_sensors['pressure']) {
|
||||
$datas[] = 'pressure';
|
||||
}
|
||||
if ($used_sensors['cooling']) {
|
||||
$datas[] = 'cooling';
|
||||
}
|
||||
|
||||
// FIXME generalize -> static-config ?
|
||||
$type_text['overview'] = "Overview";
|
||||
@@ -65,6 +71,8 @@ $type_text['load'] = "Load";
|
||||
$type_text['state'] = "State";
|
||||
$type_text['signal'] = "Signal";
|
||||
$type_text['snr'] = "SNR";
|
||||
$type_text['pressure'] = "Pressure";
|
||||
$type_text['cooling'] = "Cooling";
|
||||
|
||||
if (!$vars['metric']) {
|
||||
$vars['metric'] = "processor";
|
||||
|
7
html/pages/health/cooling.inc.php
Normal file
7
html/pages/health/cooling.inc.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
$graph_type = 'sensor_cooling';
|
||||
$class = 'cooling';
|
||||
$unit = 'w';
|
||||
|
||||
require 'pages/health/sensors.inc.php';
|
7
html/pages/health/pressure.inc.php
Normal file
7
html/pages/health/pressure.inc.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
$graph_type = 'sensor_pressure';
|
||||
$class = 'pressure';
|
||||
$unit = 'kpa';
|
||||
|
||||
require 'pages/health/sensors.inc.php';
|
@@ -1,6 +1,12 @@
|
||||
mib: PowerNet-MIB
|
||||
modules:
|
||||
sensors:
|
||||
pre-cache:
|
||||
data:
|
||||
- oid:
|
||||
- airIRG2RDT2ThresholdsRackInletHighTempMetric
|
||||
- airIRG2RDT2ThresholdsSupplyAirHighTempMetric
|
||||
- airIRG2RDT2ThresholdsReturnAirHighTempMetric
|
||||
state:
|
||||
data:
|
||||
-
|
||||
@@ -199,6 +205,33 @@ modules:
|
||||
index: 'airIRRP500UnitStatusRackInletTemperature3Metric.{{ $index }}'
|
||||
descr: 'Inlet #3'
|
||||
divisor: 10
|
||||
-
|
||||
oid: airIRG2RDT2StatusRackInletTempMetric
|
||||
num_oid: .1.3.6.1.4.1.318.1.1.13.4.5.2.1.7.
|
||||
index: 'airIRG2RDT2StatusRackInletTempMetric.{{ $index }}'
|
||||
descr: 'Rack Inlet'
|
||||
divisor: 10
|
||||
high_limit: airIRG2RDT2ThresholdsRackInletHighTempMetric
|
||||
-
|
||||
oid: airIRG2RDT2StatusSupplyAirTempMetric
|
||||
num_oid: .1.3.6.1.4.1.318.1.1.13.4.5.2.1.9.
|
||||
index: 'airIRG2RDT2StatusSupplyAirTempMetric.{{ $index }}'
|
||||
descr: 'Supply Air'
|
||||
divisor: 10
|
||||
high_limit: airIRG2RDT2ThresholdsSupplyAirHighTempMetric
|
||||
-
|
||||
oid: airIRG2RDT2StatusReturnAirTempMetric
|
||||
num_oid: .1.3.6.1.4.1.318.1.1.13.4.5.2.1.11.
|
||||
index: 'airIRG2RDT2StatusReturnAirTempMetric.{{ $index }}'
|
||||
descr: 'Return Air'
|
||||
divisor: 10
|
||||
high_limit: airIRG2RDT2ThresholdsReturnAirHighTempMetric
|
||||
-
|
||||
oid: airIRG2RDT2StatusSuctionTempMetric
|
||||
num_oid: .1.3.6.1.4.1.318.1.1.13.4.5.2.1.13.
|
||||
index: 'airIRG2RDT2StatusSuctionTempMetric.{{ $index }}'
|
||||
descr: 'Suction'
|
||||
divisor: 10
|
||||
humidity:
|
||||
data:
|
||||
-
|
||||
@@ -239,6 +272,11 @@ modules:
|
||||
index: 'airIRRP500UnitStatusAirFlowMetric.{{ $index }}'
|
||||
descr: Air Flow
|
||||
divisor: 10
|
||||
-
|
||||
oid: airIRG2RDT2StatusAirFlowMetric
|
||||
num_oid: .1.3.6.1.4.1.318.1.1.13.4.5.2.1.5.
|
||||
index: 'airIRG2RDT2StatusAirFlowMetric.{{ $index }}'
|
||||
descr: Air Flow
|
||||
voltage:
|
||||
data:
|
||||
-
|
||||
@@ -346,3 +384,29 @@ modules:
|
||||
multiplier: 10
|
||||
index: 'rPDU2DeviceStatusPower.{{ $index }}'
|
||||
descr: 'Power, Total'
|
||||
pressure:
|
||||
data:
|
||||
-
|
||||
oid: airIRG2RDT2StatusSuctionPressureMetric
|
||||
num_oid: .1.3.6.1.4.1.318.1.1.13.4.5.2.1.19.
|
||||
index: 'airIRG2RDT2StatusSuctionPressureMetric.{{ $index }}'
|
||||
descr: Suction Pressure
|
||||
-
|
||||
oid: airIRG2RDT2StatusDischargePressureMetric
|
||||
num_oid: .1.3.6.1.4.1.318.1.1.13.4.5.2.1.21.
|
||||
index: 'airIRG2RDT2StatusDischargePressureMetric.{{ $index }}'
|
||||
descr: Discharge Pressure
|
||||
cooling:
|
||||
data:
|
||||
-
|
||||
oid: airIRG2RDT2StatusCoolOutput
|
||||
num_oid: .1.3.6.1.4.1.318.1.1.13.4.5.2.1.2.
|
||||
index: 'airIRG2RDT2StatusCoolOutput.{{ $index }}'
|
||||
descr: Output
|
||||
multiplier: 100
|
||||
-
|
||||
oid: airIRG2RDT2StatusCoolDemand
|
||||
num_oid: .1.3.6.1.4.1.318.1.1.13.4.5.2.1.3.
|
||||
index: 'airIRG2RDT2StatusCoolDemand.{{ $index }}'
|
||||
descr: Demand
|
||||
multiplier: 100
|
||||
|
@@ -373,7 +373,6 @@ function sensor_low_limit($class, $current)
|
||||
case 'temperature':
|
||||
$limit = ($current * 0.7);
|
||||
break;
|
||||
|
||||
case 'voltage':
|
||||
if ($current < 0) {
|
||||
$limit = ($current * (1 + (sgn($current) * 0.15)));
|
||||
@@ -381,33 +380,27 @@ function sensor_low_limit($class, $current)
|
||||
$limit = ($current * (1 - (sgn($current) * 0.15)));
|
||||
}
|
||||
break;
|
||||
|
||||
case 'humidity':
|
||||
$limit = '30';
|
||||
break;
|
||||
|
||||
case 'frequency':
|
||||
$limit = ($current * 0.95);
|
||||
break;
|
||||
|
||||
case 'current':
|
||||
$limit = null;
|
||||
break;
|
||||
|
||||
case 'fanspeed':
|
||||
$limit = ($current * 0.80);
|
||||
break;
|
||||
|
||||
case 'power':
|
||||
$limit = null;
|
||||
break;
|
||||
|
||||
case 'signal':
|
||||
$limit = -80;
|
||||
break;
|
||||
case 'airflow':
|
||||
case 'dbm':
|
||||
case 'snr':
|
||||
case 'frequency':
|
||||
case 'pressure':
|
||||
case 'cooling':
|
||||
$limit = ($current * 0.95);
|
||||
break;
|
||||
}//end switch
|
||||
@@ -425,7 +418,6 @@ function sensor_limit($class, $current)
|
||||
case 'temperature':
|
||||
$limit = ($current * 1.60);
|
||||
break;
|
||||
|
||||
case 'voltage':
|
||||
if ($current < 0) {
|
||||
$limit = ($current * (1 - (sgn($current) * 0.15)));
|
||||
@@ -433,37 +425,28 @@ function sensor_limit($class, $current)
|
||||
$limit = ($current * (1 + (sgn($current) * 0.15)));
|
||||
}
|
||||
break;
|
||||
|
||||
case 'humidity':
|
||||
$limit = '70';
|
||||
break;
|
||||
|
||||
case 'frequency':
|
||||
$limit = ($current * 1.05);
|
||||
break;
|
||||
|
||||
case 'current':
|
||||
$limit = ($current * 1.50);
|
||||
break;
|
||||
|
||||
case 'fanspeed':
|
||||
$limit = ($current * 1.80);
|
||||
break;
|
||||
|
||||
case 'power':
|
||||
$limit = ($current * 1.50);
|
||||
break;
|
||||
|
||||
case 'fanspeed':
|
||||
$limit = ($current * 1.80);
|
||||
break;
|
||||
case 'signal':
|
||||
$limit = -30;
|
||||
break;
|
||||
|
||||
case 'load':
|
||||
$limit = 80;
|
||||
break;
|
||||
case 'airflow':
|
||||
case 'dbm':
|
||||
case 'snr':
|
||||
case 'frequency':
|
||||
case 'pressure':
|
||||
case 'cooling':
|
||||
$limit = ($current * 1.05);
|
||||
break;
|
||||
}//end switch
|
||||
|
@@ -77,6 +77,8 @@ $run_sensors = array(
|
||||
'temperature',
|
||||
'voltage',
|
||||
'snr',
|
||||
'pressure',
|
||||
'cooling',
|
||||
);
|
||||
sensors($run_sensors, $device, $valid, $pre_cache);
|
||||
unset(
|
||||
|
@@ -142,6 +142,8 @@ function record_sensor_data($device, $all_sensors)
|
||||
'signal' => 'dBm',
|
||||
'airflow' => 'cfm',
|
||||
'snr' => 'SNR',
|
||||
'pressure' => 'kPa',
|
||||
'cooling' => 'W',
|
||||
);
|
||||
|
||||
foreach ($all_sensors as $sensor) {
|
||||
|
Reference in New Issue
Block a user