Skip to content

Commit

Permalink
monitoring: Deprecate `MonitoringState' view helper
Browse files Browse the repository at this point in the history
  • Loading branch information
lippserd committed Sep 16, 2014
1 parent 92d855e commit 0a81aee
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions modules/monitoring/application/views/helpers/MonitoringState.php
Expand Up @@ -2,11 +2,17 @@
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}

/**
* @deprecated Crap.
*/
class Zend_View_Helper_MonitoringState extends Zend_View_Helper_Abstract
{
private $servicestates = array('ok', 'warning', 'critical', 'unknown', 99 => 'pending', null => 'pending');
private $hoststates = array('up', 'down', 'unreachable', 99 => 'pending', null => 'pending');

/**
* @deprecated The host or service object must know it's possible states.
*/
public function monitoringState($object, $type = 'service')
{
if ($type === 'service') {
Expand All @@ -16,26 +22,41 @@ public function monitoringState($object, $type = 'service')
}
}

/**
* @deprecated Monitoring colors are clustered.
*/
public function getServiceStateColors()
{
return array('#44bb77', '#FFCC66', '#FF5566', '#E066FF', '#77AAFF');
}

/**
* @deprecated Monitoring colors are clustered.
*/
public function getHostStateColors()
{
return array('#44bb77', '#FF5566', '#E066FF', '#77AAFF');
}

/**
* @deprecated The service object must know about it's possible states.
*/
public function getServiceStateNames()
{
return array_values($this->servicestates);
}

/**
* @deprecated The host object must know about it's possible states.
*/
public function getHostStateNames()
{
return array_values($this->hoststates);
}

/**
* @deprecated Not used anywhere.
*/
public function getStateFlags($object, $type = 'service')
{
$state_classes = array();
Expand All @@ -60,6 +81,9 @@ public function getStateFlags($object, $type = 'service')
return $state_classes;
}

/**
* @deprecated Not translated.
*/
public function getStateTitle($object, $type)
{
return strtoupper($this->monitoringState($object, $type))
Expand Down

0 comments on commit 0a81aee

Please sign in to comment.