Merge pull request #4236 from tigercomputing/fix/badges-for-disabled-active-checks
Add notification beads for disabled active checks
This commit is contained in:
commit
fbf662bb1e
|
@ -28,7 +28,12 @@ class BackendAvailabilityNavigationItemRenderer extends BadgeNavigationItemRende
|
||||||
->select()
|
->select()
|
||||||
->from(
|
->from(
|
||||||
'programstatus',
|
'programstatus',
|
||||||
array('is_currently_running', 'notifications_enabled')
|
array(
|
||||||
|
'active_host_checks_enabled',
|
||||||
|
'active_service_checks_enabled',
|
||||||
|
'is_currently_running',
|
||||||
|
'notifications_enabled'
|
||||||
|
)
|
||||||
)
|
)
|
||||||
->fetchRow();
|
->fetchRow();
|
||||||
|
|
||||||
|
@ -59,13 +64,23 @@ class BackendAvailabilityNavigationItemRenderer extends BadgeNavigationItemRende
|
||||||
}
|
}
|
||||||
$count = 0;
|
$count = 0;
|
||||||
$titles = array();
|
$titles = array();
|
||||||
|
if (! (bool) $programStatus->active_host_checks_enabled) {
|
||||||
|
$count++;
|
||||||
|
$this->state = static::STATE_WARNING;
|
||||||
|
$titles[] = mt('monitoring', 'Active host checks are disabled');
|
||||||
|
}
|
||||||
|
if (! (bool) $programStatus->active_service_checks_enabled) {
|
||||||
|
$count++;
|
||||||
|
$this->state = static::STATE_WARNING;
|
||||||
|
$titles[] = mt('monitoring', 'Active service checks are disabled');
|
||||||
|
}
|
||||||
if (! (bool) $programStatus->notifications_enabled) {
|
if (! (bool) $programStatus->notifications_enabled) {
|
||||||
$count = 1;
|
$count++;
|
||||||
$this->state = static::STATE_WARNING;
|
$this->state = static::STATE_WARNING;
|
||||||
$titles[] = mt('monitoring', 'Notifications are disabled');
|
$titles[] = mt('monitoring', 'Notifications are disabled');
|
||||||
}
|
}
|
||||||
if (! (bool) $programStatus->is_currently_running) {
|
if (! (bool) $programStatus->is_currently_running) {
|
||||||
$count = 1;
|
$count++;
|
||||||
$this->state = static::STATE_CRITICAL;
|
$this->state = static::STATE_CRITICAL;
|
||||||
array_unshift($titles, sprintf(
|
array_unshift($titles, sprintf(
|
||||||
mt('monitoring', 'Monitoring backend %s is not running'),
|
mt('monitoring', 'Monitoring backend %s is not running'),
|
||||||
|
|
Loading…
Reference in New Issue