summaryrefslogtreecommitdiffstats
path: root/modules/monitoring/configuration.php
blob: 653b01eb16ce27c9590c80c2a64ac299ecea5fd7 (plain)
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
<?php
/* Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */

use Icinga\Authentication\Auth;

/** @var $this \Icinga\Application\Modules\Module */

$this->providePermission(
    'monitoring/command/*',
    $this->translate('Allow all commands')
);
$this->providePermission(
    'monitoring/command/schedule-check',
    $this->translate('Allow scheduling host and service checks')
);
$this->providePermission(
    'monitoring/command/schedule-check/active-only',
    $this->translate('Allow scheduling host and service checks (Only on objects with active checks enabled)')
);
$this->providePermission(
    'monitoring/command/acknowledge-problem',
    $this->translate('Allow acknowledging host and service problems')
);
$this->providePermission(
    'monitoring/command/remove-acknowledgement',
    $this->translate('Allow removing problem acknowledgements')
);
$this->providePermission(
    'monitoring/command/comment/*',
    $this->translate('Allow adding and deleting host and service comments')
);
$this->providePermission(
    'monitoring/command/comment/add',
    $this->translate('Allow commenting on hosts and services')
);
$this->providePermission(
    'monitoring/command/comment/delete',
    $this->translate('Allow deleting host and service comments')
);
$this->providePermission(
    'monitoring/command/downtime/*',
    $this->translate('Allow scheduling and deleting host and service downtimes')
);
$this->providePermission(
    'monitoring/command/downtime/schedule',
    $this->translate('Allow scheduling host and service downtimes')
);
$this->providePermission(
    'monitoring/command/downtime/delete',
    $this->translate('Allow deleting host and service downtimes')
);
$this->providePermission(
    'monitoring/command/process-check-result',
    $this->translate('Allow processing host and service check results')
);
$this->providePermission(
    'monitoring/command/feature/instance',
    $this->translate('Allow processing commands for toggling features on an instance-wide basis')
);
$this->providePermission(
    'monitoring/command/feature/object/*',
    $this->translate('Allow processing commands for toggling features on host and service objects')
);
$this->providePermission(
    'monitoring/command/feature/object/active-checks',
    $this->translate('Allow processing commands for toggling active checks on host and service objects')
);
$this->providePermission(
    'monitoring/command/feature/object/passive-checks',
    $this->translate('Allow processing commands for toggling passive checks on host and service objects')
);
$this->providePermission(
    'monitoring/command/feature/object/notifications',
    $this->translate('Allow processing commands for toggling notifications on host and service objects')
);
$this->providePermission(
    'monitoring/command/feature/object/event-handler',
    $this->translate('Allow processing commands for toggling event handlers on host and service objects')
);
$this->providePermission(
    'monitoring/command/feature/object/flap-detection',
    $this->translate('Allow processing commands for toggling flap detection on host and service objects')
);
$this->providePermission(
    'monitoring/command/send-custom-notification',
    $this->translate('Allow sending custom notifications for hosts and services')
);
$this->providePermission(
    'no-monitoring/contacts',
    $this->translate('Prohibit access to contacts and contactgroups')
);

$this->provideRestriction(
    'monitoring/filter/objects',
    $this->translate('Restrict views to the Icinga objects that match the filter')
);
$this->provideRestriction(
    'monitoring/blacklist/properties',
    $this->translate('Hide the properties of monitored objects that match the filter')
);

$this->provideConfigTab('backends', array(
    'title' => $this->translate('Configure how to retrieve monitoring information'),
    'label' => $this->translate('Backends'),
    'url' => 'config'
));
$this->provideConfigTab('security', array(
    'title' => $this->translate('Configure how to protect your monitoring environment against prying eyes'),
    'label' => $this->translate('Security'),
    'url' => 'config/security'
));
$this->provideSetupWizard('Icinga\Module\Monitoring\MonitoringWizard');

/*
 * Available Search Urls
 */
$this->provideSearchUrl($this->translate('Tactical Overview'), 'monitoring/tactical', 100);
$this->provideSearchUrl($this->translate('Hosts'), 'monitoring/list/hosts?sort=host_severity&limit=10', 99);
$this->provideSearchUrl($this->translate('Services'), 'monitoring/list/services?sort=service_severity&limit=10', 98);
$this->provideSearchUrl($this->translate('Hostgroups'), 'monitoring/list/hostgroups?limit=10', 97);
$this->provideSearchUrl($this->translate('Servicegroups'), 'monitoring/list/servicegroups?limit=10', 96);

/*
 * Available navigation items
 */
$this->provideNavigationItem('host-action', $this->translate('Host Action'));
$this->provideNavigationItem('service-action', $this->translate('Service Action'));
// Notes are disabled as we're not sure whether to really make a difference between actions and notes
//$this->provideNavigationItem('host-note', $this->translate('Host Note'));
//$this->provideNavigationItem('service-note', $this->translate('Service Note'));

/*
 * Problems Section
 */
$section = $this->menuSection(N_('Problems'), array(
    'renderer' => array(
        'SummaryNavigationItemRenderer',
        'state' => 'critical'
    ),
    'icon'      => 'attention-circled',
    'priority'  => 20
));
$section->add(N_('Host Problems'), array(
    'icon'        => 'host',
    'description' => $this->translate('List current host problems'),
    'renderer'    => array(
        'MonitoringBadgeNavigationItemRenderer',
        'columns' => array(
            'hosts_down_unhandled' => $this->translate('%d unhandled hosts down')
        ),
        'state'    => 'critical',
        'dataView' => 'unhandledhostproblems'
    ),
    'url'       => 'monitoring/list/hosts?host_problem=1&sort=host_severity',
    'priority'  => 50
));
$section->add(N_('Service Problems'), array(
    'icon'        => 'service',
    'description' => $this->translate('List current service problems'),
    'renderer'    => array(
        'MonitoringBadgeNavigationItemRenderer',
        'columns' => array(
            'services_critical_unhandled' => $this->translate('%d unhandled services critical')
        ),
        'state'    => 'critical',
        'dataView' => 'unhandledserviceproblems'
    ),
    'url'       => 'monitoring/list/services?service_problem=1&sort=service_severity&dir=desc',
    'priority'  => 60
));
$section->add(N_('Service Grid'), array(
    'icon'        => 'services',
    'description' => $this->translate('Display service problems as grid'),
    'url'         => 'monitoring/list/servicegrid?problems',
    'priority'    => 70
));
$section->add(N_('Current Downtimes'), array(
    'icon'        => 'plug',
    'description' => $this->translate('List current downtimes'),
    'url'         => 'monitoring/list/downtimes?downtime_is_in_effect=1',
    'priority'    => 80
));

/*
 * Overview Section
 */
$section = $this->menuSection(N_('Overview'), array(
    'icon'      => 'binoculars',
    'priority'  => 30
));
$section->add(N_('Tactical Overview'), array(
    'icon'        => 'chart-pie',
    'description' => $this->translate('Open tactical overview'),
    'url'         => 'monitoring/tactical',
    'priority'    => 40
));
$section->add(N_('Hosts'), array(
    'icon'        => 'host',
    'description' => $this->translate('List hosts'),
    'url'         => 'monitoring/list/hosts',
    'priority'    => 50
));
$section->add(N_('Services'), array(
    'icon'        => 'service',
    'description' => $this->translate('List services'),
    'url'         => 'monitoring/list/services',
    'priority'    => 50
));
$section->add(N_('Servicegroups'), array(
    'icon'        => 'services',
    'description' => $this->translate('List service groups'),
    'url'         => 'monitoring/list/servicegroups',
    'priority'    => 60
));
$section->add(N_('Hostgroups'), array(
    'icon'        => 'host',
    'description' => $this->translate('List host groups'),
    'url'         => 'monitoring/list/hostgroups',
    'priority'    => 60
));

// Checking the permission here since navigation items don't support negating permissions
$auth = Auth::getInstance();
if ($auth->hasPermission('*') || ! $auth->hasPermission('no-monitoring/contacts')) {
    $section->add(N_('Contacts'), array(
        'icon'        => 'user',
        'description' => $this->translate('List contacts'),
        'url'         => 'monitoring/list/contacts',
        'priority'    => 70
    ));
    $section->add(N_('Contactgroups'), array(
        'icon'        => 'users',
        'description' => $this->translate('List users'),
        'url'         => 'monitoring/list/contactgroups',
        'priority'    => 70
    ));
}

$section->add(N_('Comments'), array(
    'icon'        => 'chat-empty',
    'description' => $this->translate('List comments'),
    'url'         => 'monitoring/list/comments?comment_type=comment|comment_type=ack',
    'priority'    => 80
));
$section->add(N_('Downtimes'), array(
    'icon'        => 'plug',
    'description' => $this->translate('List downtimes'),
    'url'         => 'monitoring/list/downtimes',
    'priority'    => 80
));

/*
 * History Section
 */
$section = $this->menuSection(N_('History'), array(
    'icon'      => 'history',
    'priority'  => 90
));
$section->add(N_('Event Grid'), array(
    'icon'        => 'history',
    'description' => $this->translate('Open event grid'),
    'priority'    => 10,
    'url'         => 'monitoring/list/eventgrid'
));
$section->add(N_('Event Overview'), array(
    'icon'        => 'history',
    'description' => $this->translate('Open event overview'),
    'priority'    => 20,
    'url'         => 'monitoring/list/eventhistory?timestamp>=-7%20days'
));
$section->add(N_('Notifications'), array(
    'icon'        => 'bell',
    'description' => $this->translate('List notifications'),
    'priority'    => 30,
    'url'         => 'monitoring/list/notifications?notification_timestamp>=-7%20days',
));
$section->add(N_('Timeline'), array(
    'icon'        => 'clock',
    'description' => $this->translate('Open timeline'),
    'priority'    => 40,
    'url'         => 'monitoring/timeline'
));

/*
 * Reporting Section
 */
$section = $this->menuSection(N_('Reporting'), array(
    'icon'      => 'barchart',
    'priority'  => 100
));

/*
 * Current Incidents
 */
$dashboard = $this->dashboard(N_('Current Incidents'), array('priority' => 50));
$dashboard->add(
    N_('Service Problems'),
    'monitoring/list/services?service_problem=1&limit=10&sort=service_severity',
    100
);
$dashboard->add(
    N_('Recently Recovered Services'),
    'monitoring/list/services?service_state=0&limit=10&sort=service_last_state_change&dir=desc',
    110
);
$dashboard->add(
    N_('Host Problems'),
    'monitoring/list/hosts?host_problem=1&sort=host_severity',
    120
);

/*
 * Overview
 */
//$dashboard = $this->dashboard(N_('Overview'), array('priority' => 60));
//$dashboard->add(
//    N_('Service Grid'),
//    'monitoring/list/servicegrid?limit=15,18'
//);
//$dashboard->add(
//    N_('Service Groups'),
//    'monitoring/list/servicegroups'
//);
//$dashboard->add(
//    N_('Host Groups'),
//    'monitoring/list/hostgroups'
//);

/*
 * Most Overdue
 */
$dashboard = $this->dashboard(N_('Overdue'), array('priority' => 70));
$dashboard->add(
    N_('Late Host Check Results'),
    'monitoring/list/hosts?host_next_update<now',
    100
);
$dashboard->add(
    N_('Late Service Check Results'),
    'monitoring/list/services?service_next_update<now',
    110
);
$dashboard->add(
    N_('Acknowledgements Active For At Least Three Days'),
    'monitoring/list/comments?comment_type=Ack&comment_timestamp<-3 days&sort=comment_timestamp&dir=asc',
    120
);
$dashboard->add(
    N_('Downtimes Active For More Than Three Days'),
    'monitoring/list/downtimes?downtime_is_in_effect=1&downtime_scheduled_start<-3%20days&sort=downtime_start&dir=asc',
    130
);

/*
 * Muted Objects
 */
$dashboard = $this->dashboard(N_('Muted'), array('priority' => 80));
$dashboard->add(
    N_('Disabled Service Notifications'),
    'monitoring/list/services?service_notifications_enabled=0&limit=10',
    100
);
$dashboard->add(
    N_('Disabled Host Notifications'),
    'monitoring/list/hosts?host_notifications_enabled=0&limit=10',
    110
);
$dashboard->add(
    N_('Disabled Service Checks'),
    'monitoring/list/services?service_active_checks_enabled=0&limit=10',
    120
);
$dashboard->add(
    N_('Disabled Host Checks'),
    'monitoring/list/hosts?host_active_checks_enabled=0&limit=10',
    130
);
$dashboard->add(
    N_('Acknowledged Problem Services'),
    'monitoring/list/services?service_acknowledgement_type!=0&service_problem=1&sort=service_state&limit=10',
    140
);
$dashboard->add(
    N_('Acknowledged Problem Hosts'),
    'monitoring/list/hosts?host_acknowledgement_type!=0&host_problem=1&sort=host_severity&limit=10',
    150
);

/*
 * Activity Stream
 */
//$dashboard = $this->dashboard(N_('Activity Stream'), array('priority' => 90));
//$dashboard->add(
//    N_('Recent Events'),
//    'monitoring/list/eventhistory?timestamp>=-3%20days&sort=timestamp&dir=desc&limit=8'
//);
//$dashboard->add(
//    N_('Recent Hard State Changes'),
//    'monitoring/list/eventhistory?timestamp>=-3%20days&type=hard_state&sort=timestamp&dir=desc&limit=8'
//);
//$dashboard->add(
//    N_('Recent Notifications'),
//    'monitoring/list/eventhistory?timestamp>=-3%20days&type=notify&sort=timestamp&dir=desc&limit=8'
//);
//$dashboard->add(
//    N_('Downtimes Recently Started'),
//    'monitoring/list/eventhistory?timestamp>=-3%20days&type=dt_start&sort=timestamp&dir=desc&limit=8'
//);
//$dashboard->add(
//    N_('Downtimes Recently Ended'),
//    'monitoring/list/eventhistory?timestamp>=-3%20days&type=dt_end&sort=timestamp&dir=desc&limit=8'
//);

/*
 * Stats
 */
//$dashboard = $this->dashboard(N_('Stats'), array('priority' => 99));
//$dashboard->add(
//    N_('Check Stats'),
//    'monitoring/health/stats'
//);
//$dashboard->add(
//    N_('Process Information'),
//    'monitoring/health/info'
//);

/*
 * CSS
 */
$this->provideCssFile('event-grid.less');
$this->provideCssFile('service-grid.less');
$this->provideCssFile('tables.less');