1 <?php
defined('SYSPATH') OR die('No direct access allowed.');
3 * Hosts widget for tactical overview
7 class Tac_disabled_Widget
extends widget_Base
{
8 protected $duplicatable = true;
9 public function index()
11 # fetch widget view path
12 $view_path = $this->view_path('view');
14 $current_status = $this->get_current_status();
16 # HOSTS DOWN / problems
20 if ($current_status->hst
->up_and_disabled_active
) {
21 /* TODO: check passive setting */
22 $problem[$i]['type'] = _('Host');
23 $problem[$i]['status'] = _('Up');
24 $problem[$i]['url'] = 'status/host/all/?hoststatustypes='.nagstat
::HOST_UP
.'&hostprops='.nagstat
::HOST_CHECKS_DISABLED
;
25 $problem[$i]['title'] = $current_status->hst
->up_and_disabled_active
.' '._('Disabled hosts');
29 if ($current_status->hst
->down_and_disabled_active
) {
30 /* TODO: check passive setting */
31 $problem[$i]['type'] = _('Host');
32 $problem[$i]['status'] = _('Down');
33 $problem[$i]['url'] = 'status/host/all/?hoststatustypes='.nagstat
::HOST_DOWN
.'&hostprops='.nagstat
::HOST_CHECKS_DISABLED
;
34 $problem[$i]['title'] = $current_status->hst
->down_and_disabled_active
.' '._('Disabled hosts');
38 if ($current_status->hst
->unreachable_and_disabled_active
) {
39 /* TODO: check passive setting */
40 $problem[$i]['type'] = _('Host');
41 $problem[$i]['status'] = _('Unreachable');
42 $problem[$i]['url'] = 'status/host/all/?hoststatustypes='.nagstat
::HOST_UNREACHABLE
.'&hostprops='.nagstat
::HOST_CHECKS_DISABLED
;
43 $problem[$i]['title'] = $current_status->hst
->unreachable_and_disabled_active
.' '._('Disabled hosts');
47 if ($current_status->hst
->pending_and_disabled
) {
48 $problem[$i]['type'] = _('Host');
49 $problem[$i]['status'] = _('Pending');
50 $problem[$i]['url'] = 'status/host/all/?hoststatustypes='.nagstat
::HOST_PENDING
.'&hostprops='.nagstat
::HOST_CHECKS_DISABLED
;
51 $problem[$i]['title'] = $current_status->hst
->pending_and_disabled
.' '._('Disabled hosts');
55 if ($current_status->svc
->ok_and_disabled_active
) {
56 /* TODO: check passive setting */
57 $problem[$i]['type'] = _('Service');
58 $problem[$i]['status'] = _('OK');
59 $problem[$i]['url'] = 'status/service/all/?servicestatustypes='.nagstat
::SERVICE_OK
.'&serviceprops='.nagstat
::SERVICE_CHECKS_DISABLED
;
60 $problem[$i]['title'] = $current_status->svc
->ok_and_disabled_active
.' '._('Disabled services');
64 if ($current_status->svc
->warning_and_disabled_active
) {
65 /* TODO: check passive setting */
66 $problem[$i]['type'] = _('Service');
67 $problem[$i]['status'] = _('Warning');
68 $problem[$i]['url'] = 'status/service/all/?servicestatustypes='.nagstat
::SERVICE_WARNING
.'&serviceprops='.nagstat
::SERVICE_CHECKS_DISABLED
;
69 $problem[$i]['title'] = $current_status->svc
->warning_and_disabled_active
.' '._('Disabled services');
73 if ($current_status->svc
->critical_and_disabled_active
) {
74 /* TODO: check passive setting */
75 $problem[$i]['type'] = _('Service');
76 $problem[$i]['status'] = _('Critical');
77 $problem[$i]['url'] = 'status/service/all/?servicestatustypes='.nagstat
::SERVICE_CRITICAL
.'&serviceprops='.nagstat
::SERVICE_CHECKS_DISABLED
;
78 $problem[$i]['title'] = $current_status->svc
->critical_and_disabled_active
.' '._('Disabled services');
82 if ($current_status->svc
->unknown_and_disabled_active
) {
83 /* TODO: check passive setting */
84 $problem[$i]['type'] = _('Service');
85 $problem[$i]['status'] = _('Unknown');
86 $problem[$i]['url'] = 'status/service/all/?servicestatustypes='.nagstat
::SERVICE_UNKNOWN
.'&serviceprops='.nagstat
::SERVICE_CHECKS_DISABLED
;
87 $problem[$i]['title'] = $current_status->svc
->unknown_and_disabled_active
.' '._('Disabled services');
91 if ($current_status->svc
->pending_and_disabled
) {
92 $problem[$i]['type'] = _('Service');
93 $problem[$i]['status'] = _('Pending');
94 $problem[$i]['url'] = 'status/service/all/?servicestatustypes='.nagstat
::SERVICE_PENDING
.'&serviceprops='.nagstat
::SERVICE_CHECKS_DISABLED
;
95 $problem[$i]['title'] = $current_status->svc
->pending_and_disabled
.' '._('Disabled services');