1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
|
<?php
/*
** Zabbix
** Copyright (C) 2001-2014 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
require_once dirname(__FILE__).'/js/administration.general.housekeeper.edit.js.php';
$houseKeeperTab = new CFormList('scriptsTab');
// events and alerts
$eventAlertTab = new CTable(null, 'formElementTable');
$eventsMode = new CCheckBox('hk_events_mode', $this->data['config']['hk_events_mode'], null, 1);
$eventAlertTab->addRow(array(
new CLabel(_('Enable internal housekeeping'), 'hk_events_mode'),
$eventsMode
));
$houseKeeperEventsTrigger = new CNumericBox('hk_events_trigger', $this->data['config']['hk_events_trigger'], 5);
$houseKeeperEventsInternal = new CNumericBox('hk_events_internal', $this->data['config']['hk_events_internal'], 5);
$houseKeeperEventsDiscovery = new CNumericBox('hk_events_discovery', $this->data['config']['hk_events_discovery'], 5);
$houseKeeperEventsAutoreg = new CNumericBox('hk_events_autoreg', $this->data['config']['hk_events_autoreg'], 5);
if (!$this->data['config']['hk_events_mode']) {
$houseKeeperEventsTrigger->setAttribute('disabled', 'disabled');
$houseKeeperEventsInternal->setAttribute('disabled', 'disabled');
$houseKeeperEventsDiscovery->setAttribute('disabled', 'disabled');
$houseKeeperEventsAutoreg->setAttribute('disabled', 'disabled');
}
$eventAlertTab->addRow(array(
new CLabel(_('Trigger data storage period (in days)'), 'hk_events_trigger'),
$houseKeeperEventsTrigger
));
$eventAlertTab->addRow(array(
new CLabel(_('Internal data storage period (in days)'), 'hk_events_internal'),
$houseKeeperEventsInternal
));
$eventAlertTab->addRow(array(
new CLabel(_('Network discovery data storage period (in days)'), 'hk_events_discovery'),
$houseKeeperEventsDiscovery
));
$eventAlertTab->addRow(array(
new CLabel(_('Auto-registration data storage period (in days)'), 'hk_events_autoreg'),
$houseKeeperEventsAutoreg
));
$eventAlertTab->addClass('border_dotted objectgroup element-row element-row-first');
$houseKeeperTab->addRow(_('Events and alerts'), new CDiv($eventAlertTab));
// IT services
$itServicesTab = new CTable(null, 'formElementTable');
$itServicesTab->addRow(array(
new CLabel(_('Enable internal housekeeping'), 'hk_services_mode'),
new CCheckBox('hk_services_mode', $this->data['config']['hk_services_mode'], null, 1)
));
$houseKeeperServicesMode = new CNumericBox('hk_services', $this->data['config']['hk_services'], 5);
if (!$this->data['config']['hk_services_mode']) {
$houseKeeperServicesMode->setAttribute('disabled', 'disabled');
}
$itServicesTab->addRow(array(
new CLabel(_('Data storage period (in days)'), 'hk_services'),
$houseKeeperServicesMode
));
$itServicesTab->addClass('border_dotted objectgroup element-row');
$houseKeeperTab->addRow(_('IT services'), new CDiv($itServicesTab));
// audit
$auditTab = new CTable(null, 'formElementTable');
$auditTab->addRow(array(
new CLabel(_('Enable internal housekeeping'), 'hk_audit_mode'),
new CCheckBox('hk_audit_mode', $this->data['config']['hk_audit_mode'], null, 1)
));
$houseKeeperAuditMode = new CNumericBox('hk_audit', $this->data['config']['hk_audit'], 5);
if (!$this->data['config']['hk_audit_mode']) {
$houseKeeperAuditMode->setAttribute('disabled', 'disabled');
}
$auditTab->addRow(array(
new CLabel(_('Data storage period (in days)'), 'hk_audit'),
$houseKeeperAuditMode
));
$auditTab->addClass('border_dotted objectgroup element-row');
$houseKeeperTab->addRow(_('Audit'), new CDiv($auditTab));
// user session
$userSessionTab = new CTable(null, 'formElementTable');
$userSessionTab->addRow(array(
new CLabel(_('Enable internal housekeeping'), 'hk_sessions_mode'),
new CCheckBox('hk_sessions_mode', $this->data['config']['hk_sessions_mode'], null, 1)
));
$houseKeeperSessionsMode = new CNumericBox('hk_sessions', $this->data['config']['hk_sessions'], 5);
if (!$this->data['config']['hk_sessions_mode']) {
$houseKeeperSessionsMode->setAttribute('disabled', 'disabled');
}
$userSessionTab->addRow(array(
new CLabel(_('Data storage period (in days)'), 'hk_sessions'),
$houseKeeperSessionsMode
));
$userSessionTab->addClass('border_dotted objectgroup element-row');
$houseKeeperTab->addRow(_('User sessions'), new CDiv($userSessionTab));
// history
$histortTab = new CTable(null, 'formElementTable');
$histortTab->addRow(array(
new CLabel(_('Enable internal housekeeping'), 'hk_history_mode'),
new CCheckBox('hk_history_mode', $this->data['config']['hk_history_mode'], null, 1)
));
$houseKeeperHistoryGlobal = new CCheckBox('hk_history_global', $this->data['config']['hk_history_global'], null, 1);
$houseKeeperHistoryModeGlobal = new CNumericBox('hk_history', $this->data['config']['hk_history'], 5);
if (!$this->data['config']['hk_history_global']) {
$houseKeeperHistoryModeGlobal->setAttribute('disabled', 'disabled');
}
$histortTab->addRow(array(new CLabel(_('Override item history period'),
'hk_history_global'), $houseKeeperHistoryGlobal));
$histortTab->addRow(array(
new CLabel(_('Data storage period (in days)'), 'hk_history'),
$houseKeeperHistoryModeGlobal
));
$histortTab->addClass('border_dotted objectgroup element-row');
$houseKeeperTab->addRow(_('History'), new CDiv($histortTab));
// trend
$trendTab = new CTable(null, 'formElementTable');
$trendTab->addRow(array(
new CLabel(_('Enable internal housekeeping'), 'hk_trends_mode'),
new CCheckBox('hk_trends_mode', $this->data['config']['hk_trends_mode'], null, 1)
));
$houseKeeperTrendGlobal = new CCheckBox('hk_trends_global', $this->data['config']['hk_trends_global'], null, 1);
$houseKeeperTrendModeGlobal = new CNumericBox('hk_trends', $this->data['config']['hk_trends'], 5);
if (!$this->data['config']['hk_trends_global']) {
$houseKeeperTrendModeGlobal->setAttribute('disabled', 'disabled');
}
$trendTab->addRow(array(new CLabel(_('Override item trend period'),
'hk_trends_global'), $houseKeeperTrendGlobal));
$trendTab->addRow(array(
new CLabel(_('Data storage period (in days)'), 'hk_trends'),
$houseKeeperTrendModeGlobal
));
$trendTab->addClass('border_dotted objectgroup element-row');
$houseKeeperTab->addRow(_('Trends'), new CDiv($trendTab));
$houseKeeperView = new CTabView();
$houseKeeperView->addTab('houseKeeper', _('Housekeeping'), $houseKeeperTab);
$houseKeeperForm = new CForm();
$houseKeeperForm->setName('houseKeeperForm');
$houseKeeperForm->addVar('form_refresh', $this->data['form_refresh'] + 1);
$houseKeeperForm->addItem($houseKeeperView);
$houseKeeperForm->addItem(makeFormFooter(new CSubmit('save', _('Save')), new CButton('resetDefaults', _('Reset defaults'))));
return $houseKeeperForm;
|