mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Merge pull request #2972 from murrant/issue-2883
Deal with 0 value for sensor data better.
This commit is contained in:
@ -12,7 +12,7 @@ if (count($sensors)) {
|
||||
echo ' </div>
|
||||
<table class="table table-hover table-condensed table-striped">';
|
||||
foreach ($sensors as $sensor) {
|
||||
if (empty($sensor['sensor_current'])) {
|
||||
if (!isset($sensor['sensor_current'])) {
|
||||
$sensor['sensor_current'] = 'NaN';
|
||||
}
|
||||
|
||||
|
@ -83,7 +83,7 @@ function poll_sensor($device, $class, $unit) {
|
||||
$sensor_value = 0;
|
||||
}
|
||||
|
||||
if ($sensor['sensor_divisor']) {
|
||||
if ($sensor['sensor_divisor'] && $sensor_value !== 0) {
|
||||
$sensor_value = ($sensor_value / $sensor['sensor_divisor']);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user