Use neutral default color in perfdata piecharts
If nothing is known about the state of the monitoring object, the piecharts should neither indicate OK nor Critical.
This commit is contained in:
parent
c93b13b138
commit
41c101d99f
|
@ -56,7 +56,7 @@ EOD;
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
private $colors = array('#44bb77', '#ffaa44', '#ff5566', '#ddccdd');
|
||||
private $colors = array('#049BAF', '#ffaa44', '#ff5566', '#ddccdd');
|
||||
|
||||
/**
|
||||
* The title of the chart
|
||||
|
|
|
@ -19,7 +19,7 @@ class Zend_View_Helper_Perfdata extends Zend_View_Helper_Abstract
|
|||
*
|
||||
* @return string
|
||||
*/
|
||||
public function perfdata($perfdataStr, $compact = false, $color = Perfdata::PERFDATA_GREEN)
|
||||
public function perfdata($perfdataStr, $compact = false, $color = Perfdata::PERFDATA_DEFAULT)
|
||||
{
|
||||
$pieChartData = PerfdataSet::fromString($perfdataStr)->asArray();
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
use Icinga\Module\Monitoring\Object\Host;
|
||||
use Icinga\Module\Monitoring\Object\Service;
|
||||
use Icinga\Module\Monitoring\Plugin\Perfdata;
|
||||
|
||||
$helper = $this->getHelper('MonitoringState');
|
||||
|
||||
|
|
|
@ -11,8 +11,7 @@ use Zend_Controller_Front;
|
|||
|
||||
class Perfdata
|
||||
{
|
||||
const PERFDATA_GREEN = 'green';
|
||||
const PERFDATA_ORANGE = 'orange';
|
||||
const PERFDATA_DEFAULT = 'green';
|
||||
const PERFDATA_RED = 'red';
|
||||
|
||||
/**
|
||||
|
@ -346,7 +345,7 @@ class Perfdata
|
|||
$green = $orange = $red = 0;
|
||||
|
||||
switch ($color) {
|
||||
case self::PERFDATA_GREEN:
|
||||
case self::PERFDATA_DEFAULT:
|
||||
$green = $usedValue;
|
||||
break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue