histogram: Make histograms crash less
[ninja.git] / application / widgets / tac_disabled / tac_disabled.php
blob636b9c1e8abcd392a2e6bd200f0d70cfcbcfcd16
1 <?php defined('SYSPATH') OR die('No direct access allowed.');
2 /**
3 * Hosts widget for tactical overview
5 * @author op5 AB
6 */
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
17 $problem = array();
18 $i = 0;
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');
26 $i++;
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');
35 $i++;
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');
44 $i++;
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');
52 $i++;
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');
61 $i++;
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');
70 $i++;
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');
79 $i++;
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');
88 $i++;
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');
96 $i++;
99 require($view_path);