Merge branch 'master' into feature/setup-wizard-7163
This commit is contained in:
commit
cbadaa78d6
|
@ -96,7 +96,7 @@ class ConfigController extends ActionController
|
|||
try {
|
||||
$manager->enableModule($module);
|
||||
$manager->loadModule($module);
|
||||
Notification::success('Module "' . $module . '" enabled');
|
||||
Notification::success(sprintf($this->translate('Module "%s" enabled'), $module));
|
||||
$this->rerenderLayout()->reloadCss()->redirectNow('config/modules');
|
||||
} catch (Exception $e) {
|
||||
$this->view->exceptionMesssage = $e->getMessage();
|
||||
|
@ -115,7 +115,7 @@ class ConfigController extends ActionController
|
|||
$manager = Icinga::app()->getModuleManager();
|
||||
try {
|
||||
$manager->disableModule($module);
|
||||
Notification::success('Module "' . $module . '" disabled');
|
||||
Notification::success(sprintf($this->translate('Module "%s" disabled'), $module));
|
||||
$this->rerenderLayout()->reloadCss()->redirectNow('config/modules');
|
||||
} catch (Exception $e) {
|
||||
$this->view->exceptionMessage = $e->getMessage();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<div class="controls">
|
||||
<?= $this->tabs ?>
|
||||
<h1>Installed Modules</h1>
|
||||
<h1><?= $this->translate('Installed Modules') ?></h1>
|
||||
<?= $this->paginationControl($modules) ?>
|
||||
</div>
|
||||
|
||||
|
@ -11,9 +11,9 @@
|
|||
<tr>
|
||||
<td>
|
||||
<?php if ($module->enabled): ?>
|
||||
<?= $this->icon('success.png', 'Module is enabled') ?>
|
||||
<?= $this->icon('success.png', $this->translate('Module is enabled')) ?>
|
||||
<?php else: ?>
|
||||
<?= $this->icon('remove.png', 'Module is disabled') ?>
|
||||
<?= $this->icon('remove.png', $this->translate('Module is disabled')) ?>
|
||||
<? endif ?>
|
||||
<a href="<?= $this->url(
|
||||
'config/module/',
|
||||
|
|
|
@ -278,7 +278,8 @@ class Web extends ApplicationBootstrap
|
|||
|
||||
if ($this->user !== null && $this->user->getPreferences() !== null) {
|
||||
$detect = new TimezoneDetect();
|
||||
$userTimezone = $this->user->getPreferences()->get('app.timezone', $detect->getTimezoneName());
|
||||
$userTimezone = $this->user->getPreferences()
|
||||
->getValue('icingaweb', 'timezone', $detect->getTimezoneName());
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -302,7 +303,7 @@ class Web extends ApplicationBootstrap
|
|||
{
|
||||
parent::setupInternationalization();
|
||||
if ($this->user !== null && $this->user->getPreferences() !== null
|
||||
&& (($locale = $this->user->getPreferences()->get('app.language')) !== null)
|
||||
&& (($locale = $this->user->getPreferences()->getValue('icingaweb', 'language')) !== null)
|
||||
) {
|
||||
try {
|
||||
Translator::setupLocale($locale);
|
||||
|
|
|
@ -79,19 +79,38 @@ class Preferences implements Countable
|
|||
}
|
||||
|
||||
/**
|
||||
* Retrieve a preference and return $default if the preference is not set
|
||||
* Retrieve a preference section
|
||||
*
|
||||
* @param string $name
|
||||
* @param mixed $default
|
||||
*
|
||||
* @return mixed
|
||||
* @return array|null
|
||||
*/
|
||||
public function get($name, $default = null)
|
||||
public function get($name)
|
||||
{
|
||||
if (array_key_exists($name, $this->preferences)) {
|
||||
return $this->preferences[$name];
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve a value from a specific section
|
||||
*
|
||||
* @param string $section
|
||||
* @param string $name
|
||||
* @param null $default
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
public function getValue($section, $name, $default = null)
|
||||
{
|
||||
if (array_key_exists($section, $this->preferences)
|
||||
&& array_key_exists($name, $this->preferences[$section])
|
||||
) {
|
||||
return $this->preferences[$section][$name];
|
||||
}
|
||||
|
||||
return $default;
|
||||
}
|
||||
|
||||
|
|
|
@ -370,7 +370,7 @@ class ActionController extends Zend_Controller_Action
|
|||
if ($user = $req->getUser()) {
|
||||
// Cast preference app.show_benchmark to bool because preferences loaded from a preferences storage are
|
||||
// always strings
|
||||
if ((bool) $user->getPreferences()->get('app.show_benchmark', false) === true) {
|
||||
if ((bool) $user->getPreferences()->getValue('icingaweb', 'show_benchmark', false) === true) {
|
||||
if (!$this->_helper->viewRenderer->getNoRender()) {
|
||||
$layout->benchmark = $this->renderBenchmark();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
// {{{ICINGA_LICENSE_HEADER}}}
|
||||
// {{{ICINGA_LICENSE_HEADER}}}
|
||||
|
||||
namespace Icinga\Web\Form\Element;
|
||||
|
||||
use Zend_Form_Element_Xhtml;
|
||||
|
||||
/**
|
||||
* Implements note element for Zend forms
|
||||
*/
|
||||
class Note extends Zend_Form_Element_Xhtml
|
||||
{
|
||||
/**
|
||||
* Name of the view helper
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $helper = 'formNote';
|
||||
|
||||
/**
|
||||
* Return true to ensure redrawing
|
||||
*
|
||||
* @param mixed $value The value of to validate (ignored)
|
||||
* @return bool Always true
|
||||
*/
|
||||
public function isValid($value)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -274,7 +274,7 @@ class Monitoring_ChartController extends Controller
|
|||
),
|
||||
'colors' => array('#44bb77', '#ff4444', '#ff0000', '#E066FF', '#f099FF', '#fefefe'),
|
||||
'labels'=> array(
|
||||
(int) $query->hosts_up . ' Up Hosts',
|
||||
(int) $query->hosts_up . t(' Up Hosts'),
|
||||
(int) $query->hosts_down_handled . t(' Down Hosts (Handled)'),
|
||||
(int) $query->hosts_down_unhandled . t(' Down Hosts (Unhandled)'),
|
||||
(int) $query->hosts_unreachable_handled . t(' Unreachable Hosts (Handled)'),
|
||||
|
@ -294,7 +294,7 @@ class Monitoring_ChartController extends Controller
|
|||
),
|
||||
'colors' => array('#44bb77', '#ff4444', '#ff0000', '#ffff00', '#ffff33', '#E066FF', '#f099FF', '#fefefe'),
|
||||
'labels'=> array(
|
||||
$query->services_ok . ' Up Services',
|
||||
$query->services_ok . t(' Up Services'),
|
||||
$query->services_warning_handled . t(' Warning Services (Handled)'),
|
||||
$query->services_warning_unhandled . t(' Warning Services (Unhandled)'),
|
||||
$query->services_critical_handled . t(' Down Services (Handled)'),
|
||||
|
|
|
@ -115,14 +115,17 @@ class Monitoring_CommandController extends Controller
|
|||
if ($targetConfig->get($instance)) {
|
||||
$this->target = new CommandPipe($targetConfig->get($instance));
|
||||
} else {
|
||||
throw new ConfigurationError('Instance is not configured: %s', $instance);
|
||||
throw new ConfigurationError(
|
||||
$this->translate('Instance is not configured: %s'),
|
||||
$instance
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if ($targetConfig && $targetInfo = $targetConfig->current()) {
|
||||
// Take the very first section
|
||||
$this->target = new CommandPipe($targetInfo);
|
||||
} else {
|
||||
throw new ConfigurationError('No instances are configured yet');
|
||||
throw new ConfigurationError($this->translate('No instances are configured yet'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -143,12 +143,12 @@ class Monitoring_ListController extends Controller
|
|||
$this->applyFilters($query);
|
||||
|
||||
$this->setupSortControl(array(
|
||||
'host_last_check' => 'Last Check',
|
||||
'host_severity' => 'Severity',
|
||||
'host_name' => 'Hostname',
|
||||
'host_address' => 'Address',
|
||||
'host_state' => 'Current State',
|
||||
'host_state' => 'Hard State'
|
||||
'host_last_check' => $this->translate('Last Check'),
|
||||
'host_severity' => $this->translate('Severity'),
|
||||
'host_name' => $this->translate('Hostname'),
|
||||
'host_address' => $this->translate('Address'),
|
||||
'host_state' => $this->translate('Current State'),
|
||||
'host_state' => $this->translate('Hard State')
|
||||
));
|
||||
$this->view->hosts = $query->paginate();
|
||||
}
|
||||
|
@ -220,16 +220,16 @@ class Monitoring_ListController extends Controller
|
|||
|
||||
$this->applyFilters($query);
|
||||
$this->setupSortControl(array(
|
||||
'service_last_check' => 'Last Service Check',
|
||||
'service_severity' => 'Severity',
|
||||
'service_state' => 'Current Service State',
|
||||
'service_description' => 'Service Name',
|
||||
'service_state_type' => 'Hard State',
|
||||
'host_severity' => 'Host Severity',
|
||||
'host_state' => 'Current Host State',
|
||||
'host_name' => 'Host Name',
|
||||
'host_address' => 'Host Address',
|
||||
'host_last_check' => 'Last Host Check'
|
||||
'service_last_check' => $this->translate('Last Service Check'),
|
||||
'service_severity' => $this->translate('Severity'),
|
||||
'service_state' => $this->translate('Current Service State'),
|
||||
'service_description' => $this->translate('Service Name'),
|
||||
'service_state_type' => $this->translate('Hard State'),
|
||||
'host_severity' => $this->translate('Host Severity'),
|
||||
'host_state' => $this->translate('Current Host State'),
|
||||
'host_name' => $this->translate('Host Name'),
|
||||
'host_address' => $this->translate('Host Address'),
|
||||
'host_last_check' => $this->translate('Last Host Check')
|
||||
));
|
||||
$limit = $this->params->get('limit');
|
||||
$this->view->limit = $limit;
|
||||
|
@ -291,15 +291,15 @@ class Monitoring_ListController extends Controller
|
|||
$this->applyFilters($query);
|
||||
$this->view->downtimes = $query->paginate();
|
||||
$this->setupSortControl(array(
|
||||
'downtime_is_in_effect' => 'Is In Effect',
|
||||
'downtime_host' => 'Host / Service',
|
||||
'downtime_entry_time' => 'Entry Time',
|
||||
'downtime_author' => 'Author',
|
||||
'downtime_start' => 'Start Time',
|
||||
'downtime_start' => 'End Time',
|
||||
'downtime_scheduled_start' => 'Scheduled Start',
|
||||
'downtime_scheduled_end' => 'Scheduled End',
|
||||
'downtime_duration' => 'Duration',
|
||||
'downtime_is_in_effect' => $this->translate('Is In Effect'),
|
||||
'downtime_host' => $this->translate('Host / Service'),
|
||||
'downtime_entry_time' => $this->translate('Entry Time'),
|
||||
'downtime_author' => $this->translate('Author'),
|
||||
'downtime_start' => $this->translate('Start Time'),
|
||||
'downtime_start' => $this->translate('End Time'),
|
||||
'downtime_scheduled_start' => $this->translate('Scheduled Start'),
|
||||
'downtime_scheduled_end' => $this->translate('Scheduled End'),
|
||||
'downtime_duration' => $this->translate('Duration'),
|
||||
));
|
||||
$this->view->delDowntimeForm = new DeleteDowntimeCommandForm();
|
||||
}
|
||||
|
@ -322,7 +322,7 @@ class Monitoring_ListController extends Controller
|
|||
$this->applyFilters($query);
|
||||
$this->view->notifications = $query->paginate();
|
||||
$this->setupSortControl(array(
|
||||
'notification_start_time' => 'Notification Start'
|
||||
'notification_start_time' => $this->translate('Notification Start')
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -353,12 +353,12 @@ class Monitoring_ListController extends Controller
|
|||
$this->view->contacts = $query->paginate();
|
||||
|
||||
$this->setupSortControl(array(
|
||||
'contact_name' => 'Name',
|
||||
'contact_alias' => 'Alias',
|
||||
'contact_email' => 'Email',
|
||||
'contact_pager' => 'Pager Address / Number',
|
||||
'contact_notify_service_timeperiod' => 'Service Notification Timeperiod',
|
||||
'contact_notify_host_timeperiod' => 'Host Notification Timeperiod'
|
||||
'contact_name' => $this->translate('Name'),
|
||||
'contact_alias' => $this->translate('Alias'),
|
||||
'contact_email' => $this->translate('Email'),
|
||||
'contact_pager' => $this->translate('Pager Address / Number'),
|
||||
'contact_notify_service_timeperiod' => $this->translate('Service Notification Timeperiod'),
|
||||
'contact_notify_host_timeperiod' => $this->translate('Host Notification Timeperiod')
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -453,10 +453,10 @@ class Monitoring_ListController extends Controller
|
|||
|
||||
$this->setupSortControl(
|
||||
array(
|
||||
'comment_timestamp' => 'Comment Timestamp',
|
||||
'comment_host' => 'Host / Service',
|
||||
'comment_type' => 'Comment Type',
|
||||
'comment_expiration' => 'Expiration',
|
||||
'comment_timestamp' => $this->translate('Comment Timestamp'),
|
||||
'comment_host' => $this->translate('Host / Service'),
|
||||
'comment_type' => $this->translate('Comment Type'),
|
||||
'comment_expiration' => $this->translate('Expiration'),
|
||||
)
|
||||
);
|
||||
$this->view->delCommentForm = new DeleteCommentCommandForm();
|
||||
|
@ -489,7 +489,7 @@ class Monitoring_ListController extends Controller
|
|||
$this->applyFilters($query);
|
||||
$this->view->servicegroups = $query->paginate();
|
||||
$this->setupSortControl(array(
|
||||
'servicegroup_name' => 'Servicegroup Name'
|
||||
'servicegroup_name' => $this->translate('Servicegroup Name')
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -520,12 +520,16 @@ class Monitoring_ListController extends Controller
|
|||
$this->applyFilters($query);
|
||||
$this->view->hostgroups = $query->paginate();
|
||||
$this->setupSortControl(array(
|
||||
'hostgroup_name' => 'Hostgroup Name'
|
||||
'hostgroup_name' => $this->translate('Hostgroup Name')
|
||||
));
|
||||
}
|
||||
|
||||
public function eventhistoryAction()
|
||||
{
|
||||
if ($url = $this->hasBetterUrl()) {
|
||||
return $this->redirectNow($url);
|
||||
}
|
||||
|
||||
$this->addTitleTab('eventhistory');
|
||||
$query = $this->backend->select()->from('eventHistory', array(
|
||||
'host_name',
|
||||
|
@ -561,8 +565,8 @@ class Monitoring_ListController extends Controller
|
|||
));
|
||||
$this->applyFilters($query);
|
||||
$this->setupSortControl(array(
|
||||
'host_name' => 'Hostname',
|
||||
'service_description' => 'Service description'
|
||||
'host_name' => $this->translate('Hostname'),
|
||||
'service_description' => $this->translate('Service description')
|
||||
));
|
||||
$pivot = $query->pivot('service_description', 'host_name');
|
||||
$this->view->pivot = $pivot;
|
||||
|
|
|
@ -59,12 +59,12 @@ class Monitoring_MultiController extends Controller
|
|||
|
||||
// Handle configuration changes
|
||||
$this->handleConfigurationForm(array(
|
||||
'host_passive_checks_enabled' => 'Passive Checks',
|
||||
'host_active_checks_enabled' => 'Active Checks',
|
||||
'host_notifications_enabled' => 'Notifications',
|
||||
'host_event_handler_enabled' => 'Event Handler',
|
||||
'host_flap_detection_enabled' => 'Flap Detection',
|
||||
'host_obsessing' => 'Obsessing'
|
||||
'host_passive_checks_enabled' => $this->translate('Passive Checks'),
|
||||
'host_active_checks_enabled' => $this->translate('Active Checks'),
|
||||
'host_notifications_enabled' => $this->translate('Notifications'),
|
||||
'host_event_handler_enabled' => $this->translate('Event Handler'),
|
||||
'host_flap_detection_enabled' => $this->translate('Flap Detection'),
|
||||
'host_obsessing' => $this->translate('Obsessing')
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -127,12 +127,12 @@ class Monitoring_MultiController extends Controller
|
|||
$this->view->errors = $errors;
|
||||
|
||||
$this->handleConfigurationForm(array(
|
||||
'service_passive_checks_enabled' => 'Passive Checks',
|
||||
'service_active_checks_enabled' => 'Active Checks',
|
||||
'service_notifications_enabled' => 'Notifications',
|
||||
'service_event_handler_enabled' => 'Event Handler',
|
||||
'service_flap_detection_enabled' => 'Flap Detection',
|
||||
'service_obsessing' => 'Obsessing',
|
||||
'service_passive_checks_enabled' => $this->translate('Passive Checks'),
|
||||
'service_active_checks_enabled' => $this->translate('Active Checks'),
|
||||
'service_notifications_enabled' => $this->translate('Notifications'),
|
||||
'service_event_handler_enabled' => $this->translate('Event Handler'),
|
||||
'service_flap_detection_enabled' => $this->translate('Flap Detection'),
|
||||
'service_obsessing' => $this->translate('Obsessing'),
|
||||
));
|
||||
}
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ use DateInterval;
|
|||
use Icinga\Module\Monitoring\Command\Instance\DisableNotificationsExpireCommand;
|
||||
use Icinga\Module\Monitoring\Form\Command\CommandForm;
|
||||
use Icinga\Web\Form\Element\DateTimePicker;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Web\Notification;
|
||||
use Icinga\Web\Request;
|
||||
|
||||
|
@ -33,12 +34,13 @@ class DisableNotificationsExpireCommandForm extends CommandForm
|
|||
public function createElements(array $formData = array())
|
||||
{
|
||||
$this->addElement(
|
||||
'note',
|
||||
'command-info',
|
||||
array(
|
||||
'value' => mt(
|
||||
'monitoring',
|
||||
'This command is used to disable host and service notifications for a specific time.'
|
||||
new Note(
|
||||
'command-info',
|
||||
array(
|
||||
'value' => mt(
|
||||
'monitoring',
|
||||
'This command is used to disable host and service notifications for a specific time.'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
|
|
@ -8,6 +8,7 @@ use DateTime;
|
|||
use DateInterval;
|
||||
use Icinga\Module\Monitoring\Command\Object\AcknowledgeProblemCommand;
|
||||
use Icinga\Web\Form\Element\DateTimePicker;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Web\Notification;
|
||||
use Icinga\Web\Request;
|
||||
|
||||
|
@ -34,8 +35,7 @@ class AcknowledgeProblemCommandForm extends ObjectsCommandForm
|
|||
public function createElements(array $formData = array())
|
||||
{
|
||||
$this->addElements(array(
|
||||
array(
|
||||
'note',
|
||||
new Note(
|
||||
'command-info',
|
||||
array(
|
||||
'value' => mt(
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
namespace Icinga\Module\Monitoring\Form\Command\Object;
|
||||
|
||||
use Icinga\Module\Monitoring\Command\Object\AddCommentCommand;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Web\Notification;
|
||||
use Icinga\Web\Request;
|
||||
|
||||
|
@ -31,8 +32,7 @@ class AddCommentCommandForm extends ObjectsCommandForm
|
|||
public function createElements(array $formData = array())
|
||||
{
|
||||
$this->addElements(array(
|
||||
array(
|
||||
'note',
|
||||
new Note(
|
||||
'command-info',
|
||||
array(
|
||||
'value' => mt(
|
||||
|
|
|
@ -6,6 +6,7 @@ namespace Icinga\Module\Monitoring\Form\Command\Object;
|
|||
|
||||
use Icinga\Module\Monitoring\Command\Object\ScheduleHostCheckCommand;
|
||||
use Icinga\Module\Monitoring\Command\Object\ScheduleServiceCheckCommand;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Web\Notification;
|
||||
use Icinga\Web\Request;
|
||||
|
||||
|
@ -30,8 +31,7 @@ class CheckNowCommandForm extends ObjectsCommandForm
|
|||
public function addSubmitButton()
|
||||
{
|
||||
$this->addElements(array(
|
||||
array(
|
||||
'note', // Bogus
|
||||
new Note(
|
||||
'icon', // Bogus
|
||||
array(
|
||||
'decorators' => array(array(
|
||||
|
|
|
@ -8,6 +8,7 @@ use DateTime;
|
|||
use DateInterval;
|
||||
use Icinga\Module\Monitoring\Command\Object\ScheduleServiceCheckCommand;
|
||||
use Icinga\Web\Form\Element\DateTimePicker;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Web\Notification;
|
||||
use Icinga\Web\Request;
|
||||
|
||||
|
@ -36,8 +37,7 @@ class ScheduleServiceCheckCommandForm extends ObjectsCommandForm
|
|||
$checkTime = new DateTime();
|
||||
$checkTime->add(new DateInterval('PT1H'));
|
||||
$this->addElements(array(
|
||||
array(
|
||||
'note',
|
||||
new Note(
|
||||
'command-info',
|
||||
array(
|
||||
'value' => mt(
|
||||
|
|
|
@ -8,6 +8,7 @@ use DateTime;
|
|||
use DateInterval;
|
||||
use Icinga\Module\Monitoring\Command\Object\ScheduleServiceDowntimeCommand;
|
||||
use Icinga\Web\Form\Element\DateTimePicker;
|
||||
use Icinga\Web\Form\Element\Note;
|
||||
use Icinga\Web\Form\Element\Number;
|
||||
use Icinga\Web\Notification;
|
||||
use Icinga\Web\Request;
|
||||
|
@ -48,8 +49,7 @@ class ScheduleServiceDowntimeCommandForm extends ObjectsCommandForm
|
|||
$end = clone $start;
|
||||
$end->add(new DateInterval('PT1H'));
|
||||
$this->addElements(array(
|
||||
array(
|
||||
'note',
|
||||
new Note(
|
||||
'command-info',
|
||||
array(
|
||||
'value' => mt(
|
||||
|
|
|
@ -56,10 +56,12 @@ class SecurityConfigForm extends ConfigForm
|
|||
'protected_customvars',
|
||||
array(
|
||||
'required' => true,
|
||||
'label' => 'Protected Custom Variables',
|
||||
'description' => 'Comma separated case insensitive list of protected custom variables.'
|
||||
'label' => t('Protected Custom Variables'),
|
||||
'description' => t(
|
||||
'Comma separated case insensitive list of protected custom variables.'
|
||||
. ' Use * as a placeholder for zero or more wildcard characters.'
|
||||
. ' Existance of those custom variables will be shown, but their values will be masked.'
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,27 +1,27 @@
|
|||
<div class="nav navbar-nav topbar-host-status-summary">
|
||||
<span class="topbar-status-up">
|
||||
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 0)); ?>" title="Hosts Up">
|
||||
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 0)); ?>" title="<?= $this->translate('Hosts Up') ?>">
|
||||
<?= $hostSummary->hosts_up ?>
|
||||
</a>
|
||||
</span>
|
||||
<span class="topbar-status-down">
|
||||
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 1, 'host_unhandled' => 1)); ?>" title="Hosts Down Unhandled">
|
||||
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 1, 'host_unhandled' => 1)); ?>" title="<?= $this->translate('Hosts Down Unhandled') ?>">
|
||||
<?= $hostSummary->hosts_down_unhandled ?>
|
||||
</a>/
|
||||
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 1, 'host_handled' => 1)); ?>" title="Hosts Down Handled">
|
||||
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 1, 'host_handled' => 1)); ?>" title="<?= $this->translate('Hosts Down Handled') ?>">
|
||||
<?= $hostSummary->hosts_down_handled ?>
|
||||
</a>
|
||||
</span>
|
||||
<span class="topbar-status-unreachable">
|
||||
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 2, 'host_unhandled' => 1)); ?>" title="Hosts Unreachable Unhandled">
|
||||
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 2, 'host_unhandled' => 1)); ?>" title="<?= $this->translate('Hosts Unreachable Unhandled') ?>">
|
||||
<?= $hostSummary->hosts_unreachable_unhandled ?>
|
||||
</a>/
|
||||
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 2, 'host_handled' => 1)); ?>" title="Hosts Unreachable Handled">
|
||||
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 2, 'host_handled' => 1)); ?>" title="<?= $this->translate('Hosts Unreachable Handled') ?>">
|
||||
<?= $hostSummary->hosts_unreachable_handled ?>
|
||||
</a>
|
||||
</span>
|
||||
<span class="topbar-status-pending">
|
||||
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 99)); ?>" title="Hosts Pending">
|
||||
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 99)); ?>" title="<?= $this->translate('Hosts Pending') ?>">
|
||||
<?= $hostSummary->hosts_pending ?>
|
||||
</a>
|
||||
</span>
|
||||
|
@ -29,36 +29,36 @@
|
|||
|
||||
<div class="nav navbar-nav topbar-service-status-summary">
|
||||
<span class="topbar-status-ok">
|
||||
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 0)); ?>" title="Services Ok">
|
||||
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 0)); ?>" title="<?= $this->translate('Services Ok') ?>">
|
||||
<?= $serviceSummary->services_ok ?>
|
||||
</a>
|
||||
</span>
|
||||
<span class="topbar-status-critical">
|
||||
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 2, 'service_unhandled' => 1)); ?>" title="Services Critical Unhandled">
|
||||
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 2, 'service_unhandled' => 1)); ?>" title="<?= $this->translate('Services Critical Unhandled') ?>">
|
||||
<?= $serviceSummary->services_critical_unhandled ?>
|
||||
</a>/
|
||||
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 2, 'service_handled' => 1)); ?>" title="Services Critical Handled">
|
||||
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 2, 'service_handled' => 1)); ?>" title="<?= $this->translate('Services Critical Handled') ?>">
|
||||
<?= $serviceSummary->services_critical_handled ?>
|
||||
</a>
|
||||
</span>
|
||||
<span class="topbar-status-warning">
|
||||
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 1, 'service_unhandled' => 1)); ?>" title="Services Warning Unhandled">
|
||||
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 1, 'service_unhandled' => 1)); ?>" title="<?= $this->translate('Services Warning Unhandled') ?>">
|
||||
<?= $serviceSummary->services_warning_unhandled ?>
|
||||
</a>/
|
||||
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 1, 'service_handled' => 1)); ?>" title="Services Warning Handled">
|
||||
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 1, 'service_handled' => 1)); ?>" title="<?= $this->translate('Services Warning Handled') ?>">
|
||||
<?= $serviceSummary->services_warning_handled ?>
|
||||
</a>
|
||||
</span>
|
||||
<span class="topbar-status-unknown">
|
||||
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 3, 'service_unhandled' => 1)); ?>" title="Services Unknown Unhandled">
|
||||
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 3, 'service_unhandled' => 1)); ?>" title="<?= $this->translate('Services Unknown Unhandled') ?>">
|
||||
<?= $serviceSummary->services_unknown_unhandled ?>
|
||||
</a>/
|
||||
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 3, 'service_handled' => 1)); ?>" title="Services Unknown Handled">
|
||||
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 3, 'service_handled' => 1)); ?>" title="<?= $this->translate('Services Unknown Handled') ?>">
|
||||
<?= $serviceSummary->services_unknown_handled ?>
|
||||
</a>
|
||||
</span>
|
||||
<span class="topbar-status-pending">
|
||||
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 99)); ?>" title="Services Pending">
|
||||
<a href="<?= $this->href('monitoring/list/services', array('service_state' => 99)); ?>" title="<?= $this->translate('Services Pending') ?>">
|
||||
<?= $serviceSummary->services_pending ?>
|
||||
</a>
|
||||
</span>
|
||||
|
|
|
@ -29,7 +29,16 @@
|
|||
<td class="state">
|
||||
<strong><?= $downtime->is_in_effect ? $this->translate('Expires') : $this->translate('Starts'); ?></strong>
|
||||
<br>
|
||||
<?= $this->prefixedTimeUntil($downtime->is_in_effect ? $downtime->end : $downtime->start); ?>
|
||||
<?=
|
||||
$this->dateTimeRenderer(
|
||||
($downtime->is_in_effect ? $downtime->end : $downtime->start),
|
||||
true
|
||||
)->render(
|
||||
$this->translate('on %s', 'datetime'),
|
||||
$this->translate('at %s', 'time'),
|
||||
$this->translate('in %s', 'timespan')
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php if (isset($downtime->service)): ?>
|
||||
|
|
|
@ -40,8 +40,8 @@ if (count($hostgroups) === 0) {
|
|||
'host_unhandled' => 1,
|
||||
'hostgroup' => $h->hostgroup
|
||||
)
|
||||
); ?>" title="Hosts DOWN Unhandled">
|
||||
<?= $h->hosts_down_unhandled; ?> DOWN
|
||||
); ?>" title="<?= $this->translate('Hosts DOWN Unhandled') ?>">
|
||||
<?= $h->hosts_down_unhandled; ?> <?= $this->translate('DOWN', 'icinga.state') ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
<?php if ($h->hosts_down_handled): ?>
|
||||
|
@ -52,8 +52,8 @@ if (count($hostgroups) === 0) {
|
|||
'host_handled' => 1,
|
||||
'hostgroup' => $h->hostgroup
|
||||
)
|
||||
); ?>" title="Hosts DOWN Handled">
|
||||
<?= $h->hosts_down_handled . ' ' . ($h->hosts_down_unhandled ? $this->translate('Acknowledged') : 'DOWN'); ?>
|
||||
); ?>" title="<?= $this->translate('Hosts DOWN Handled') ?>">
|
||||
<?= $h->hosts_down_handled . ' ' . ($h->hosts_down_unhandled ? $this->translate('Acknowledged') : $this->translate('DOWN', 'icinga.state')); ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
|
@ -70,8 +70,8 @@ if (count($hostgroups) === 0) {
|
|||
'host_unhandled' => 1,
|
||||
'hostgroup' => $h->hostgroup
|
||||
)
|
||||
); ?>" title="Hosts UNREACHABLE Unhandled">
|
||||
<?= $h->hosts_unreachable_unhandled; ?> UNREACHABLE
|
||||
); ?>" title="<?= $this->translate('Hosts UNREACHABLE Unhandled') ?>">
|
||||
<?= $h->hosts_unreachable_unhandled; ?> <?= $this->translate('UNREACHABLE', 'icinga.state') ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
<?php if ($h->hosts_unreachable_handled): ?>
|
||||
|
@ -82,8 +82,8 @@ if (count($hostgroups) === 0) {
|
|||
'host_handled' => 1,
|
||||
'hostgroup' => $h->hostgroup
|
||||
)
|
||||
); ?>" title="Hosts UNREACHABLE Handled">
|
||||
<?= $h->hosts_unreachable_handled . ' ' . ($h->hosts_unreachable_unhandled ? $this->translate('Acknowledged') : 'UNREACHABLE'); ?>
|
||||
); ?>" title="<?= $this->translate('Hosts UNREACHABLE Handled') ?>">
|
||||
<?= $h->hosts_unreachable_handled . ' ' . ($h->hosts_unreachable_unhandled ? $this->translate('Acknowledged') : $this->translate('UNREACHABLE', 'icinga.state')) ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
|
@ -98,8 +98,8 @@ if (count($hostgroups) === 0) {
|
|||
'host_state' => 0,
|
||||
'hostgroup' => $h->hostgroup
|
||||
)
|
||||
); ?>" title="Hosts UP">
|
||||
<?= $h->hosts_up; ?> UP
|
||||
); ?>" title="<?= $this->translate('Hosts UP') ?>">
|
||||
<?= $h->hosts_up; ?> <?= $this->translate('UP', 'icinga.state') ?>
|
||||
</a>
|
||||
</div>
|
||||
<!-- End of Hosts UP -->
|
||||
|
@ -113,8 +113,8 @@ if (count($hostgroups) === 0) {
|
|||
'host_state' => 99,
|
||||
'hostgroup' => $h->hostgroup
|
||||
)
|
||||
); ?>" title="Hosts PENDING">
|
||||
<?= $h->hosts_pending; ?> PENDING
|
||||
); ?>" title="<?= $this->translate('Hosts PENDING') ?>">
|
||||
<?= $h->hosts_pending; ?> <?= $this->translate('PENDING', 'icinga.state') ?>
|
||||
</a>
|
||||
</div>
|
||||
<!-- End of Hosts PENDING -->
|
||||
|
@ -135,8 +135,8 @@ if (count($hostgroups) === 0) {
|
|||
'hostgroup' => $h->hostgroup,
|
||||
'sort' => 'service_severity'
|
||||
)
|
||||
); ?>" title="Services CRITICAL Unhandled">
|
||||
<?= $h->services_critical_unhandled; ?> CRITICAL
|
||||
); ?>" title="<?= $this->translate('Services CRITICAL Unhandled') ?>">
|
||||
<?= $h->services_critical_unhandled; ?> <?= $this->translate('CRITICAL', 'icinga.state') ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
<?php if ($h->services_critical_handled): ?>
|
||||
|
@ -148,8 +148,8 @@ if (count($hostgroups) === 0) {
|
|||
'hostgroup' => $h->hostgroup,
|
||||
'sort' => 'service_severity'
|
||||
)
|
||||
); ?>" title="Services CRITICAL Handled">
|
||||
<?= $h->services_critical_handled . ' ' . ($h->services_critical_unhandled ? $this->translate('Acknowledged') : 'CRITICAL'); ?>
|
||||
); ?>" title="<?= $this->translate('Services CRITICAL Handled') ?>">
|
||||
<?= $h->services_critical_handled . ' ' . ($h->services_critical_unhandled ? $this->translate('Acknowledged') : $this->translate('CRITICAL', 'icinga.state')); ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
|
@ -169,8 +169,8 @@ if (count($hostgroups) === 0) {
|
|||
'hostgroup' => $h->hostgroup,
|
||||
'sort' => 'service_severity'
|
||||
)
|
||||
); ?>" title="Services WARNING Unhandled">
|
||||
<?= $h->services_warning_unhandled; ?> WARNING
|
||||
); ?>" title="<?= $this->translate('Services WARNING Unhandled') ?>">
|
||||
<?= $h->services_warning_unhandled; ?> <?= $this->translate('WARNING', 'icinga.state') ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
<?php if ($h->services_warning_handled): ?>
|
||||
|
@ -182,8 +182,8 @@ if (count($hostgroups) === 0) {
|
|||
'hostgroup' => $h->hostgroup,
|
||||
'sort' => 'service_severity'
|
||||
)
|
||||
); ?>" title="Services WARNING Handled">
|
||||
<?= $h->services_warning_handled . ' ' . ($h->services_warning_unhandled ? $this->translate('Acknowledged') : 'WARNING'); ?>
|
||||
); ?>" title="<?= $this->translate('Services WARNING Handled') ?>">
|
||||
<?= $h->services_warning_handled . ' ' . ($h->services_warning_unhandled ? $this->translate('Acknowledged') : $this->translate('WARNING', 'icinga.state')); ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
|
@ -203,8 +203,8 @@ if (count($hostgroups) === 0) {
|
|||
'hostgroup' => $h->hostgroup,
|
||||
'sort' => 'service_severity'
|
||||
)
|
||||
); ?>" title="Services UNKNOWN Unhandled">
|
||||
<?= $h->services_unknown_unhandled; ?> UNKNOWN
|
||||
); ?>" title="<?= $this->translate('Services UNKNOWN Unhandled') ?>">
|
||||
<?= $h->services_unknown_unhandled; ?> <?= $this->translate('UNKNOWN', 'icinga.state') ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
<?php if ($h->services_unknown_handled): ?>
|
||||
|
@ -216,8 +216,8 @@ if (count($hostgroups) === 0) {
|
|||
'hostgroup' => $h->hostgroup,
|
||||
'sort' => 'service_severity'
|
||||
)
|
||||
); ?>" title="Services UNKNOWN Handled">
|
||||
<?= $h->services_unknown_handled . ' ' . ($h->services_unknown_unhandled ? $this->translate('Acknowledged') : 'UNKNOWN'); ?>
|
||||
); ?>" title="<?= $this->translate('Services UNKNOWN Handled') ?>">
|
||||
<?= $h->services_unknown_handled . ' ' . ($h->services_unknown_unhandled ? $this->translate('Acknowledged') : $this->translate('UNKNOWN', 'icinga.state')); ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
</div>
|
||||
|
@ -233,8 +233,8 @@ if (count($hostgroups) === 0) {
|
|||
'hostgroup' => $h->hostgroup,
|
||||
'sort' => 'service_severity'
|
||||
)
|
||||
); ?>" title="Services OK">
|
||||
<?= $h->services_ok; ?> OK
|
||||
); ?>" title="<?= $this->translate('Services OK') ?>">
|
||||
<?= $h->services_ok; ?> <?= $this->translate('OK', 'icinga.state') ?>
|
||||
</a>
|
||||
</div>
|
||||
<!-- End of Services OK -->
|
||||
|
@ -249,8 +249,8 @@ if (count($hostgroups) === 0) {
|
|||
'hostgroup' => $h->hostgroup,
|
||||
'sort' => 'service_severity'
|
||||
)
|
||||
); ?>" title="Services PENDING">
|
||||
<?= $h->services_pending; ?> PENDING
|
||||
); ?>" title="<?= $this->translate('Services PENDING') ?>">
|
||||
<?= $h->services_pending; ?> <?= $this->translate('PENDING', 'icinga.state') ?>
|
||||
</a>
|
||||
</div>
|
||||
<!-- End of Services PENDING -->
|
||||
|
|
|
@ -47,35 +47,35 @@ if ($hosts->count() === 0) {
|
|||
|
||||
$icons = array();
|
||||
if (! $host->host_handled && $host->host_state > 0){
|
||||
$icons[] = $this->icon('unhandled.png', 'Unhandled');
|
||||
$icons[] = $this->icon('unhandled.png', $this->translate('Unhandled'));
|
||||
}
|
||||
|
||||
if ($host->host_acknowledged) {
|
||||
$icons[] = $this->icon('acknowledgement.png', 'Acknowledged');
|
||||
$icons[] = $this->icon('acknowledgement.png', $this->translate('Acknowledged'));
|
||||
}
|
||||
|
||||
if ($host->host_is_flapping) {
|
||||
$icons[] = $this->icon('flapping.png', 'Flapping');
|
||||
$icons[] = $this->icon('flapping.png', $this->translate('Flapping'));
|
||||
}
|
||||
|
||||
if (! $host->host_notifications_enabled) {
|
||||
$icons[] = $this->icon('notification_disabled.png', 'Notifications Disabled');
|
||||
$icons[] = $this->icon('notification_disabled.png', $this->translate('Notifications Disabled'));
|
||||
}
|
||||
|
||||
if ($host->host_in_downtime) {
|
||||
$icons[] = $this->icon('in_downtime.png', 'In Downtime');
|
||||
$icons[] = $this->icon('in_downtime.png', $this->translate('In Downtime'));
|
||||
}
|
||||
|
||||
if (! $host->host_active_checks_enabled) {
|
||||
if (! $host->host_passive_checks_enabled) {
|
||||
$icons[] = $this->icon('active_passive_checks_disabled.png', 'Active And Passive Checks Disabled');
|
||||
$icons[] = $this->icon('active_passive_checks_disabled.png', $this->translate('Active And Passive Checks Disabled'));
|
||||
} else {
|
||||
$icons[] = $this->icon('active_checks_disabled.png', 'Active Checks Disabled');
|
||||
$icons[] = $this->icon('active_checks_disabled.png', $this->translate('Active Checks Disabled'));
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($host->host_last_comment) && $host->host_last_comment !== null) {
|
||||
$icons[] = $this->icon('comment.png', 'Comment: ' . $host->host_last_comment);
|
||||
$icons[] = $this->icon('comment.png', $this->translate('Comment: ') . $host->host_last_comment);
|
||||
}
|
||||
?>
|
||||
<tr class="state <?= $hostStateName ?><?= $host->host_handled ? ' handled' : '' ?>">
|
||||
|
@ -101,8 +101,10 @@ if ($hosts->count() === 0) {
|
|||
<?php if (isset($host->host_unhandled_services) && $host->host_unhandled_services > 0): ?>
|
||||
<span title="<?=
|
||||
$host->host_unhandled_services
|
||||
?> Service Problems on Host"> (<?= $this->qlink(
|
||||
sprintf($this->translate('%d unhandled services'), $host->host_unhandled_services),
|
||||
?> <?= $this->translate('Service Problems on Host') ?>"> (<?= $this->qlink(
|
||||
sprintf(
|
||||
$this->translatePlural('%d unhandled service', '%d unhandled services', $host->host_unhandled_services),
|
||||
$host->host_unhandled_services),
|
||||
'monitoring/show/services',
|
||||
array(
|
||||
'host' => $host->host_name,
|
||||
|
|
|
@ -43,8 +43,8 @@ if (count($servicegroups) === 0) {
|
|||
'host_unhandled' => 1,
|
||||
'servicegroup' => $servicegroup->servicegroup
|
||||
)
|
||||
); ?>" title="Hosts DOWN Unhandled">
|
||||
<?= $servicegroup->hosts_down_unhandled; ?> DOWN
|
||||
); ?>" title="<?= $this->translate('Hosts DOWN Unhandled') ?>">
|
||||
<?= $servicegroup->hosts_down_unhandled; ?> <?= $this->translate('DOWN', 'icinga.state') ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
<?php if ($servicegroup->hosts_down_handled): ?>
|
||||
|
@ -55,7 +55,7 @@ if (count($servicegroups) === 0) {
|
|||
'host_handled' => 1,
|
||||
'servicegroup' => $servicegroup->servicegroup
|
||||
)
|
||||
); ?>" title="Hosts DOWN Handled">
|
||||
); ?>" title="<?= $this->translate('Hosts DOWN Handled') ?>">
|
||||
<?= $servicegroup->hosts_down_handled . ' ' . ($servicegroup->hosts_down_unhandled ? $this->translate('Acknowledged') : 'DOWN'); ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
|
@ -73,8 +73,8 @@ if (count($servicegroups) === 0) {
|
|||
'host_unhandled' => 1,
|
||||
'servicegroup' => $servicegroup->servicegroup
|
||||
)
|
||||
); ?>" title="Hosts UNREACHABLE Unhandled">
|
||||
<?= $servicegroup->hosts_unreachable_unhandled; ?> UNREACHABLE
|
||||
); ?>" title="<?= $this->translate('Hosts UNREACHABLE Unhandled') ?>">
|
||||
<?= $servicegroup->hosts_unreachable_unhandled; ?> <?= $this->translate('UNREACHABLE', 'icinga.state') ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
<?php if ($servicegroup->hosts_unreachable_handled): ?>
|
||||
|
@ -85,7 +85,7 @@ if (count($servicegroups) === 0) {
|
|||
'host_handled' => 1,
|
||||
'servicegroup' => $servicegroup->servicegroup
|
||||
)
|
||||
); ?>" title="Hosts UNREACHABLE Handled">
|
||||
); ?>" title="<?= $this->translate('Hosts UNREACHABLE Handled') ?>">
|
||||
<?= $servicegroup->hosts_unreachable_handled . ' ' . ($servicegroup->hosts_unreachable_unhandled ? $this->translate('Acknowledged') : 'UNREACHABLE'); ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
|
@ -101,8 +101,8 @@ if (count($servicegroups) === 0) {
|
|||
'host_state' => 0,
|
||||
'servicegroup' => $servicegroup->servicegroup
|
||||
)
|
||||
); ?>" title="Hosts UP">
|
||||
<?= $servicegroup->hosts_up; ?> UP
|
||||
); ?>" title="<?= $this->translate('Hosts UP') ?>">
|
||||
<?= $servicegroup->hosts_up; ?> <?= $this->translate('UP', 'icinga.state') ?>
|
||||
</a>
|
||||
</div>
|
||||
<!-- End of Hosts UP -->
|
||||
|
@ -116,8 +116,8 @@ if (count($servicegroups) === 0) {
|
|||
'host_state' => 99,
|
||||
'servicegroup' => $servicegroup->servicegroup
|
||||
)
|
||||
); ?>" title="Hosts PENDING">
|
||||
<?= $servicegroup->hosts_pending; ?> PENDING
|
||||
); ?>" title="<?= $this->translate('Hosts PENDING') ?>">
|
||||
<?= $servicegroup->hosts_pending; ?> <?= $this->translate('PENDING', 'icinga.state') ?>
|
||||
</a>
|
||||
</div>
|
||||
<!-- End of Hosts PENDING -->
|
||||
|
@ -138,8 +138,8 @@ if (count($servicegroups) === 0) {
|
|||
'servicegroup' => $servicegroup->servicegroup,
|
||||
'sort' => 'service_severity'
|
||||
)
|
||||
); ?>" title="Services CRITICAL Unhandled">
|
||||
<?= $servicegroup->services_critical_unhandled; ?> CRITICAL
|
||||
); ?>" title="<?= $this->translate('Services CRITICAL Unhandled') ?>">
|
||||
<?= $servicegroup->services_critical_unhandled; ?> <?= $this->translate('CRITICAL', 'icinga.state') ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
<?php if ($servicegroup->services_critical_handled): ?>
|
||||
|
@ -151,7 +151,7 @@ if (count($servicegroups) === 0) {
|
|||
'servicegroup' => $servicegroup->servicegroup,
|
||||
'sort' => 'service_severity'
|
||||
)
|
||||
); ?>" title="Services CRITICAL Handled">
|
||||
); ?>" title="<?= $this->translate('Services CRITICAL Handled') ?>">
|
||||
<?= $servicegroup->services_critical_handled . ' ' . ($servicegroup->services_critical_unhandled ? $this->translate('Acknowledged') : 'CRITICAL'); ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
|
@ -172,8 +172,8 @@ if (count($servicegroups) === 0) {
|
|||
'servicegroup' => $servicegroup->servicegroup,
|
||||
'sort' => 'service_severity'
|
||||
)
|
||||
); ?>" title="Services WARNING Unhandled">
|
||||
<?= $servicegroup->services_warning_unhandled; ?> WARNING
|
||||
); ?>" title="<?= $this->translate('Services WARNING Unhandled') ?>">
|
||||
<?= $servicegroup->services_warning_unhandled; ?> <?= $this->translate('WARNING', 'icinga.state') ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
<?php if ($servicegroup->services_warning_handled): ?>
|
||||
|
@ -185,7 +185,7 @@ if (count($servicegroups) === 0) {
|
|||
'servicegroup' => $servicegroup->servicegroup,
|
||||
'sort' => 'service_severity'
|
||||
)
|
||||
); ?>" title="Services WARNING Handled">
|
||||
); ?>" title="<?= $this->translate('Services WARNING Handled') ?>">
|
||||
<?= $servicegroup->services_warning_handled . ' ' . ($servicegroup->services_warning_unhandled ? $this->translate('Acknowledged') : 'WARNING'); ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
|
@ -206,8 +206,8 @@ if (count($servicegroups) === 0) {
|
|||
'servicegroup' => $servicegroup->servicegroup,
|
||||
'sort' => 'service_severity'
|
||||
)
|
||||
); ?>" title="Services UNKNOWN Unhandled">
|
||||
<?= $servicegroup->services_unknown_unhandled; ?> UNKNOWN
|
||||
); ?>" title="<?= $this->translate('Services UNKNOWN Unhandled') ?>">
|
||||
<?= $servicegroup->services_unknown_unhandled; ?> <?= $this->translate('UNKNOWN', 'icinga.state') ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
<?php if ($servicegroup->services_unknown_handled): ?>
|
||||
|
@ -219,7 +219,7 @@ if (count($servicegroups) === 0) {
|
|||
'servicegroup' => $servicegroup->servicegroup,
|
||||
'sort' => 'service_severity'
|
||||
)
|
||||
); ?>" title="Services UNKNOWN Handled">
|
||||
); ?>" title="<?= $this->translate('Services UNKNOWN Handled') ?>">
|
||||
<?= $servicegroup->services_unknown_handled . ' ' . ($servicegroup->services_unknown_unhandled ? $this->translate('Acknowledged') : 'UNKNOWN'); ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
|
@ -236,8 +236,8 @@ if (count($servicegroups) === 0) {
|
|||
'servicegroup' => $servicegroup->servicegroup,
|
||||
'sort' => 'service_severity'
|
||||
)
|
||||
); ?>" title="Services OK">
|
||||
<?= $servicegroup->services_ok; ?> OK
|
||||
); ?>" title="<?= $this->translate('Services OK') ?>">
|
||||
<?= $servicegroup->services_ok; ?> <?= $this->translate('OK', 'icinga.state') ?>
|
||||
</a>
|
||||
</div>
|
||||
<!-- End of Services OK -->
|
||||
|
@ -252,8 +252,8 @@ if (count($servicegroups) === 0) {
|
|||
'servicegroup' => $servicegroup->servicegroup,
|
||||
'sort' => 'service_severity'
|
||||
)
|
||||
); ?>" title="Services PENDING">
|
||||
<?= $servicegroup->services_pending; ?> PENDING
|
||||
); ?>" title="<?= $this->translate('Services PENDING') ?>">
|
||||
<?= $servicegroup->services_pending; ?> <?= $this->translate('PENDING', 'icinga.state') ?>
|
||||
</a>
|
||||
</div>
|
||||
<!-- End of Services PENDING -->
|
||||
|
|
|
@ -69,36 +69,36 @@ foreach ($services as $service):
|
|||
<?= $this->perfdata($service->service_perfdata, true, true) ?>
|
||||
|
||||
<?php if (!$service->service_handled && $service->service_state > 0): ?>
|
||||
<?= $this->icon('unhandled.png', 'Unhandled') ?>
|
||||
<?= $this->icon('unhandled.png', $this->translate('Unhandled')) ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($service->service_acknowledged && !$service->service_in_downtime): ?>
|
||||
<?= $this->icon('acknowledgement.png', 'Acknowledged' . (
|
||||
<?= $this->icon('acknowledgement.png', $this->translate('Acknowledged') . (
|
||||
$service->service_last_ack ? ': ' . $service->service_last_ack : ''
|
||||
)) ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($service->service_is_flapping): ?>
|
||||
<?= $this->icon('flapping.png', 'Flapping') ?>
|
||||
<?= $this->icon('flapping.png', $this->translate('Flapping')) ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (!$service->service_notifications_enabled): ?>
|
||||
<?= $this->icon('notification_disabled.png', 'Notifications Disabled') ?>
|
||||
<?= $this->icon('notification_disabled.png', $this->translate('Notifications Disabled')) ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if ($service->service_in_downtime): ?>
|
||||
<?= $this->icon('in_downtime.png', 'In Downtime') ?>
|
||||
<?= $this->icon('in_downtime.png', $this->translate('In Downtime')) ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (isset($service->service_last_comment) && $service->service_last_comment !== null): ?>
|
||||
<?= $this->icon('comment.png', 'Comment: ' . $service->service_last_comment) ?>
|
||||
<?= $this->icon('comment.png', $this->translate('Comment: ') . $service->service_last_comment) ?>
|
||||
<?php endif ?>
|
||||
|
||||
<?php if (!$service->service_active_checks_enabled): ?>
|
||||
<?php if (!$service->service_passive_checks_enabled): ?>
|
||||
<?= $this->icon('active_passive_checks_disabled.png', 'Active And Passive Checks Disabled') ?>
|
||||
<?= $this->icon('active_passive_checks_disabled.png', $this->translate('Active And Passive Checks Disabled')) ?>
|
||||
<?php else: ?>
|
||||
<?= $this->icon('active_checks_disabled.png', 'Active Checks Disabled') ?>
|
||||
<?= $this->icon('active_checks_disabled.png', $this->translate('Active Checks Disabled')) ?>
|
||||
<?php endif ?>
|
||||
<?php endif ?>
|
||||
|
||||
|
|
|
@ -23,26 +23,26 @@ $obj->passive_checks_enabled =
|
|||
|
||||
$i = array();
|
||||
if (! $obj->handled && $obj->state > 0) {
|
||||
$i[] = $this->icon('unhandled.png', 'Unhandled');
|
||||
$i[] = $this->icon('unhandled.png', $this->translate('Unhandled'));
|
||||
}
|
||||
|
||||
if ($obj->acknowledged && ! $obj->in_downtime) {
|
||||
$i[] = $this->icon('acknowledgement.png', 'Acknowledged');
|
||||
$i[] = $this->icon('acknowledgement.png', $this->translate('Acknowledged'));
|
||||
}
|
||||
|
||||
if (!$obj->notifications_enabled) {
|
||||
$i[] = $this->icon('notification_disabled.png', 'Notifications Disabled');
|
||||
$i[] = $this->icon('notification_disabled.png', $this->translate('Notifications Disabled'));
|
||||
}
|
||||
|
||||
if ($obj->in_downtime) {
|
||||
$i[] = $this->icon('in_downtime.png', 'In Downtime');
|
||||
$i[] = $this->icon('in_downtime.png', $this->translate('In Downtime'));
|
||||
}
|
||||
|
||||
if (! $obj->active_checks_enabled) {
|
||||
if ($obj->passive_checks_enabled) {
|
||||
$i[] = $this->icon('active_checks_disabled.png', 'Active Checks Disabled');
|
||||
$i[] = $this->icon('active_checks_disabled.png', $this->translate('Active Checks Disabled'));
|
||||
} else {
|
||||
$i[] = $this->icon('active_passive_checks_disabled.png', 'Active And Passive Checks Disabled');
|
||||
$i[] = $this->icon('active_passive_checks_disabled.png', $this->translate('Active And Passive Checks Disabled'));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
'monitoring/list/services',
|
||||
array('host_problem' => $host_problem, 'service_state' => 2, 'service_acknowledged' => 0, 'service_in_downtime' => 0)
|
||||
); ?>">
|
||||
<?= $services_critical_unhandled; ?> CRITICAL
|
||||
<?= $services_critical_unhandled; ?> <?= $this->translate('CRITICAL', 'icinga.state') ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
<?php if ($services_critical_handled): ?>
|
||||
|
@ -13,7 +13,7 @@
|
|||
'monitoring/list/services',
|
||||
array('host_problem' => $host_problem, 'service_state' => 2, 'service_handled' => 1)
|
||||
); ?>">
|
||||
<?= $services_critical_handled . ' ' . ($services_critical_unhandled ? $this->translate('Acknowledged') : 'CRITICAL'); ?>
|
||||
<?= $services_critical_handled . ' ' . ($services_critical_unhandled ? $this->translate('Acknowledged') : $this->translate('CRITICAL', 'icinga.state')); ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
<?php if ($services_critical_passive): ?>
|
||||
|
@ -75,7 +75,7 @@
|
|||
'monitoring/list/services',
|
||||
array('host_problem' => $host_problem, 'service_state' => 1, 'service_acknowledged' => 0, 'service_in_downtime' => 0)
|
||||
); ?>">
|
||||
<?= $services_warning_unhandled; ?> WARNING
|
||||
<?= $services_warning_unhandled; ?> <?= $this->translate('WARNING', 'icinga.state') ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
<?php if ($services_warning_handled): ?>
|
||||
|
@ -83,7 +83,7 @@
|
|||
'monitoring/list/services',
|
||||
array('host_problem' => $host_problem, 'service_state' => 1, 'service_handled' => 1)
|
||||
); ?>">
|
||||
<?= $services_warning_handled . ' ' . ($services_warning_unhandled ? $this->translate('Acknowledged') : 'WARNING'); ?>
|
||||
<?= $services_warning_handled . ' ' . ($services_warning_unhandled ? $this->translate('Acknowledged') : $this->translate('WARNING', 'icinga.state')); ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
<?php if ($services_warning_passive): ?>
|
||||
|
@ -145,7 +145,7 @@
|
|||
'monitoring/list/services',
|
||||
array('host_problem' => $host_problem, 'service_state' => 3, 'service_acknowledged' => 0, 'service_in_downtime' => 0)
|
||||
); ?>">
|
||||
<?= $services_unknown_unhandled; ?> UNKNOWN
|
||||
<?= $services_unknown_unhandled; ?> <?= $this->translate('UNKNOWN', 'icinga.state') ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
<?php if ($services_unknown_handled): ?>
|
||||
|
@ -153,7 +153,7 @@
|
|||
'monitoring/list/services',
|
||||
array('host_problem' => $host_problem, 'service_state' => 3, 'service_handled' => 1)
|
||||
); ?>">
|
||||
<?= $services_unknown_handled . ' ' . ($services_unknown_unhandled ? $this->translate('Acknowledged') : 'UNKNOWN'); ?>
|
||||
<?= $services_unknown_handled . ' ' . ($services_unknown_unhandled ? $this->translate('Acknowledged') : $this->translate('UNKNOWN', 'icinga.state')); ?>
|
||||
</a>
|
||||
<?php endif ?>
|
||||
<?php if ($services_unknown_passive): ?>
|
||||
|
@ -214,7 +214,7 @@
|
|||
'monitoring/list/services',
|
||||
array('host_problem' => $host_problem, 'service_state' => 0)
|
||||
); ?>">
|
||||
<?= $services_ok; ?> OK
|
||||
<?= $services_ok; ?> <?= $this->translate('OK', 'icinga.state') ?>
|
||||
</a>
|
||||
<?php if ($services_ok_not_checked): ?>
|
||||
<a href="<?= $this->href(
|
||||
|
@ -249,7 +249,7 @@
|
|||
'monitoring/list/services',
|
||||
array('host_problem' => $host_problem, 'service_state' => 99)
|
||||
); ?>">
|
||||
<?= $services_pending; ?> PENDING
|
||||
<?= $services_pending; ?> <?= $this->translate('PENDING', 'icinga.state') ?>
|
||||
</a>
|
||||
<?php if ($services_pending_not_checked): ?>
|
||||
<a href="<?= $this->href(
|
||||
|
|
|
@ -27,14 +27,14 @@ class GroupSummaryQuery extends IdoQuery
|
|||
'services_ok' => 'SUM(CASE WHEN object_type = \'service\' AND state = 0 THEN 1 ELSE 0 END)',
|
||||
'services_pending' => 'SUM(CASE WHEN object_type = \'service\' AND state = 99 THEN 1 ELSE 0 END)',
|
||||
'services_warning' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 THEN 1 ELSE 0 END)',
|
||||
'services_warning_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)',
|
||||
'services_warning_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND acknowledged + in_downtime + host_state > 0 THEN 1 ELSE 0 END)',
|
||||
'services_critical' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 THEN 1 ELSE 0 END)',
|
||||
'services_critical_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)',
|
||||
'services_critical_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND acknowledged + in_downtime + host_state > 0 THEN 1 ELSE 0 END)',
|
||||
'services_unknown' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)',
|
||||
'services_warning_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)',
|
||||
'services_critical_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND acknowledged + in_downtime + host_state > 0 THEN 1 ELSE 0 END)',
|
||||
'services_warning_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND acknowledged + in_downtime + host_state = 0 THEN 1 ELSE 0 END)',
|
||||
'services_critical_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND acknowledged + in_downtime + host_state = 0 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND acknowledged + in_downtime + host_state = 0 THEN 1 ELSE 0 END)',
|
||||
'servicegroup' => 'servicegroup'
|
||||
)
|
||||
);
|
||||
|
|
|
@ -43,25 +43,25 @@ class StatusSummaryQuery extends IdoQuery
|
|||
'servicestatussummary' => array(
|
||||
'services_total' => 'SUM(CASE WHEN object_type = \'service\' THEN 1 ELSE 0 END)',
|
||||
'services_problem' => 'SUM(CASE WHEN object_type = \'service\' AND state > 0 THEN 1 ELSE 0 END)',
|
||||
'services_problem_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state > 0 AND (acknowledged + in_downtime + host_problem) > 0 THEN 1 ELSE 0 END)',
|
||||
'services_problem_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state > 0 AND (acknowledged + in_downtime + host_problem) = 0 THEN 1 ELSE 0 END)',
|
||||
'services_problem_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state > 0 AND acknowledged + in_downtime + host_problem > 0 THEN 1 ELSE 0 END)',
|
||||
'services_problem_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state > 0 AND acknowledged + in_downtime + host_problem = 0 THEN 1 ELSE 0 END)',
|
||||
'services_ok' => 'SUM(CASE WHEN object_type = \'service\' AND state = 0 THEN 1 ELSE 0 END)',
|
||||
'services_ok_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_pending' => 'SUM(CASE WHEN object_type = \'service\' AND state = 99 THEN 1 ELSE 0 END)',
|
||||
'services_pending_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_warning' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 THEN 1 ELSE 0 END)',
|
||||
'services_warning_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + host_problem) > 0 THEN 1 ELSE 0 END)',
|
||||
'services_warning_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + host_problem) = 0 THEN 1 ELSE 0 END)',
|
||||
'services_warning_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND acknowledged + in_downtime + host_problem > 0 THEN 1 ELSE 0 END)',
|
||||
'services_warning_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND acknowledged + in_downtime + host_problem = 0 THEN 1 ELSE 0 END)',
|
||||
'services_warning_passive' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
|
||||
'services_warning_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_critical' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 THEN 1 ELSE 0 END)',
|
||||
'services_critical_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + host_problem) > 0 THEN 1 ELSE 0 END)',
|
||||
'services_critical_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + host_problem) = 0 THEN 1 ELSE 0 END)',
|
||||
'services_critical_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND acknowledged + in_downtime + host_problem > 0 THEN 1 ELSE 0 END)',
|
||||
'services_critical_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND acknowledged + in_downtime + host_problem = 0 THEN 1 ELSE 0 END)',
|
||||
'services_critical_passive' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
|
||||
'services_critical_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_unknown' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + host_problem) > 0 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + host_problem) = 0 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND acknowledged + in_downtime + host_problem > 0 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND acknowledged + in_downtime + host_problem = 0 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_passive' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_active' => 'SUM(CASE WHEN object_type = \'service\' AND is_active_checked = 1 THEN 1 ELSE 0 END)',
|
||||
|
@ -72,39 +72,47 @@ class StatusSummaryQuery extends IdoQuery
|
|||
'services_without_flap_detection' => 'SUM(CASE WHEN object_type = \'service\' AND is_allowed_to_flap = 0 THEN 1 ELSE 0 END)',
|
||||
'services_flapping' => 'SUM(CASE WHEN object_type = \'service\' AND is_flapping = 1 THEN 1 ELSE 0 END)',
|
||||
|
||||
/*
|
||||
NOTE: in case you might wonder, please see #7303. As a quickfix I did:
|
||||
|
||||
'services_ok_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 0 THEN 1 ELSE 0 END)',
|
||||
'services_ok_not_checked_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_pending_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 99 THEN 1 ELSE 0 END)',
|
||||
'services_pending_not_checked_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_warning_handled_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 1 AND acknowledged + in_downtime > 0 THEN 1 ELSE 0 END)',
|
||||
'services_warning_unhandled_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 1 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)',
|
||||
'services_warning_passive_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 1 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
|
||||
'services_warning_not_checked_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 1 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_critical_handled_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 2 AND acknowledged + in_downtime > 0 THEN 1 ELSE 0 END)',
|
||||
'services_critical_unhandled_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 2 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)',
|
||||
'services_critical_passive_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 2 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
|
||||
'services_critical_not_checked_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 2 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_handled_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 3 AND acknowledged + in_downtime > 0 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_unhandled_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 3 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_passive_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 3 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_not_checked_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 0 OR host_state = 99) AND state = 3 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_ok_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 0 THEN 1 ELSE 0 END)',
|
||||
'services_ok_not_checked_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_pending_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 99 THEN 1 ELSE 0 END)',
|
||||
'services_pending_not_checked_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_warning_handled_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 1 AND acknowledged + in_downtime > 0 THEN 1 ELSE 0 END)',
|
||||
'services_warning_unhandled_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 1 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)',
|
||||
'services_warning_passive_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 1 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
|
||||
'services_warning_not_checked_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 1 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_critical_handled_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 2 AND acknowledged + in_downtime > 0 THEN 1 ELSE 0 END)',
|
||||
'services_critical_unhandled_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 2 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)',
|
||||
'services_critical_passive_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 2 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
|
||||
'services_critical_not_checked_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 2 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_handled_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 3 AND acknowledged + in_downtime > 0 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_unhandled_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 3 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_passive_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 3 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_not_checked_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND (host_state = 1 OR host_state = 2) AND state = 3 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)'
|
||||
:%s/(host_state = 0 OR host_state = 99)/host_state != 1 AND host_state != 2/g
|
||||
:%s/(host_state = 1 OR host_state = 2)/host_state != 0 AND host_state != 99/g
|
||||
|
||||
We have to find a better solution here.
|
||||
|
||||
*/
|
||||
'services_ok_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 1 AND host_state != 2 AND state = 0 THEN 1 ELSE 0 END)',
|
||||
'services_ok_not_checked_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 1 AND host_state != 2 AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_pending_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 1 AND host_state != 2 AND state = 99 THEN 1 ELSE 0 END)',
|
||||
'services_pending_not_checked_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 1 AND host_state != 2 AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_warning_handled_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 1 AND host_state != 2 AND state = 1 AND acknowledged + in_downtime > 0 THEN 1 ELSE 0 END)',
|
||||
'services_warning_unhandled_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 1 AND host_state != 2 AND state = 1 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)',
|
||||
'services_warning_passive_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 1 AND host_state != 2 AND state = 1 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
|
||||
'services_warning_not_checked_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 1 AND host_state != 2 AND state = 1 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_critical_handled_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 1 AND host_state != 2 AND state = 2 AND acknowledged + in_downtime > 0 THEN 1 ELSE 0 END)',
|
||||
'services_critical_unhandled_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 1 AND host_state != 2 AND state = 2 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)',
|
||||
'services_critical_passive_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 1 AND host_state != 2 AND state = 2 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
|
||||
'services_critical_not_checked_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 1 AND host_state != 2 AND state = 2 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_handled_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 1 AND host_state != 2 AND state = 3 AND acknowledged + in_downtime > 0 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_unhandled_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 1 AND host_state != 2 AND state = 3 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_passive_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 1 AND host_state != 2 AND state = 3 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_not_checked_on_ok_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 1 AND host_state != 2 AND state = 3 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_ok_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 0 AND host_state != 99 AND state = 0 THEN 1 ELSE 0 END)',
|
||||
'services_ok_not_checked_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 0 AND host_state != 99 AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_pending_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 0 AND host_state != 99 AND state = 99 THEN 1 ELSE 0 END)',
|
||||
'services_pending_not_checked_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 0 AND host_state != 99 AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_warning_handled_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 0 AND host_state != 99 AND state = 1 AND acknowledged + in_downtime > 0 THEN 1 ELSE 0 END)',
|
||||
'services_warning_unhandled_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 0 AND host_state != 99 AND state = 1 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)',
|
||||
'services_warning_passive_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 0 AND host_state != 99 AND state = 1 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
|
||||
'services_warning_not_checked_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 0 AND host_state != 99 AND state = 1 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_critical_handled_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 0 AND host_state != 99 AND state = 2 AND acknowledged + in_downtime > 0 THEN 1 ELSE 0 END)',
|
||||
'services_critical_unhandled_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 0 AND host_state != 99 AND state = 2 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)',
|
||||
'services_critical_passive_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 0 AND host_state != 99 AND state = 2 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
|
||||
'services_critical_not_checked_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 0 AND host_state != 99 AND state = 2 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_handled_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 0 AND host_state != 99 AND state = 3 AND acknowledged + in_downtime > 0 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_unhandled_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 0 AND host_state != 99 AND state = 3 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_passive_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 0 AND host_state != 99 AND state = 3 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
|
||||
'services_unknown_not_checked_on_problem_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state != 0 AND host_state != 99 AND state = 3 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)'
|
||||
)
|
||||
);
|
||||
|
||||
|
|
|
@ -44,4 +44,18 @@ class PreferfencesTest extends BaseTestCase
|
|||
|
||||
$this->assertEquals(2, count($prefs));
|
||||
}
|
||||
|
||||
public function testWhetherGetValueReturnsExpectedValue()
|
||||
{
|
||||
$prefs = new Preferences(array(
|
||||
'test' => array (
|
||||
'key1' => '1',
|
||||
'key2' => '2',
|
||||
)
|
||||
));
|
||||
|
||||
$result = $prefs->getValue('test', 'key2');
|
||||
|
||||
$this->assertEquals('2', $result, 'Preferences::getValue() do not return an expected value');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue