diff --git a/modules/monitoring/application/views/helpers/Perfdata.php b/modules/monitoring/application/views/helpers/Perfdata.php index 7b3fae266..5e17adea5 100644 --- a/modules/monitoring/application/views/helpers/Perfdata.php +++ b/modules/monitoring/application/views/helpers/Perfdata.php @@ -20,9 +20,10 @@ class Zend_View_Helper_Perfdata extends Zend_View_Helper_Abstract { $pieChartData = PerfdataSet::fromString($perfdataStr)->asArray(); $results = array(); + $keys = array('', 'label', 'value', 'min', 'max', 'warn', 'crit'); $columns = array(); $labels = array_combine( - array('', 'label', 'value', 'min', 'max', 'warn', 'crit'), + $keys, array( '', $this->view->translate('Label'), @@ -37,15 +38,23 @@ class Zend_View_Helper_Perfdata extends Zend_View_Helper_Abstract if ($perfdata->isVisualizable()) { $columns[''] = ''; } - } - foreach ($pieChartData as $perfdata) { foreach ($perfdata->toArray() as $column => $value) { - if (! empty($value)) { - $columns[$column] = $labels[$column]; + if (empty($value) || + $column === 'min' && floatval($value) === 0.0 || + $column === 'max' && $perfdata->isPercentage() && floatval($value) === 100) { + continue; } + $columns[$column] = $labels[$column]; } } - $table = array('