2 Feature: Availability reports
3 Warning: Assumes the time format is ISO-8601 (the default)
6 Given I have these hostgroups configured:
7 | hostgroup_name | alias |
8 | LinuxServers | HGALIAS-ls |
9 | WindowsServers | HGALIAS-ws |
10 | MixedGroup | HGALIAS-mg |
11 | EmptyGroup | HGALIAS-eg |
12 And I have these hosts:
13 | host_name | host_groups | alias |
14 | linux-server1 | LinuxServers,MixedGroup | HALIAS-ls1 |
15 | linux-server2 | LinuxServers | HALIAS-ls2 |
16 | win-server1 | WindowsServers | HALIAS-ws1 |
17 | win-server2 | WindowsServers,MixedGroup | HALIAS-ws2 |
18 And I have these servicegroups:
19 | servicegroup_name | alias |
22 And I have these services:
23 | service_description | host_name | check_command | notifications_enabled | active_checks_enabled | service_groups |
24 | System Load | linux-server1 | check_nrpe!load | 1 | 1 | |
25 | PING | linux-server1 | check_ping | 1 | 0 | pings |
26 | System Load | linux-server2 | check_nrpe!load | 1 | 1 | |
27 | PING | win-server1 | check_ping | 1 | 0 | pings |
28 | PING | win-server2 | check_ping | 0 | 1 | pings |
29 And I have these report data entries:
30 | timestamp | event_type | flags | attrib | host_name | service_description | state | hard | retry | downtime_depth | output |
31 | 2013-01-01 12:00:00 | 100 | NULL | NULL | | | 0 | 0 | 0 | NULL | NULL |
32 | 2013-01-01 12:00:01 | 801 | NULL | NULL | win-server1 | | 0 | 1 | 1 | NULL | OK - laa-laa |
33 | 2013-01-01 12:00:02 | 801 | NULL | NULL | linux-server1 | | 0 | 1 | 1 | NULL | OK - Sven Melander |
34 | 2013-01-01 12:00:03 | 701 | NULL | NULL | win-server1 | PING | 0 | 1 | 1 | NULL | OK - po |
35 | 2013-01-01 12:00:03 | 701 | NULL | NULL | win-server1 | PING | 1 | 0 | 1 | NULL | ERROR - tinky-winky |
37 And I have activated the configuration
39 @configuration @asmonitor @reports
40 Scenario: Generate report without objects
41 Given I am on the Host details page
42 And I hover over the "Reporting" button
43 When I click "Availability"
44 And I click "Show report"
45 Then I should see "Please select what objects to base the report on"
46 And I should see "Report Settings"
48 @configuration @asmonitor @reports
49 Scenario: Generate report on empty hostgroup
50 Given I am on the Host details page
51 And I hover over the "Reporting" button
52 When I click "Availability"
53 And I select "EmptyGroup" from "Available hostgroups"
54 And I doubleclick "EmptyGroup"
55 Then "Selected hostgroups" should have option "EmptyGroup"
56 When I click "Show report"
57 Then I should see "The groups you selected (EmptyGroup) had no members, so cannot create a report from them"
58 And I should see "Report Settings"
60 @configuration @asmonitor @reports
61 Scenario: Generate report on empty servicegroup
62 Given I am on the Host details page
63 And I hover over the "Reporting" button
64 When I click "Availability"
65 And I select "Servicegroups" from "Report type"
66 And I select "empty" from "Available servicegroups"
67 And I doubleclick "empty"
68 Then "Selected servicegroups" should have option "empty"
69 When I click "Show report"
70 Then I should see "The groups you selected (empty) had no members, so cannot create a report from them"
71 And I should see "Report Settings"
73 @configuration @asmonitor @reports
74 Scenario: Generate single host report
75 Given I am on the Host details page
76 And I hover over the "Reporting" button
77 When I click "Availability"
78 And I select "Hosts" from "Report type"
79 And I select "linux-server1" from "Available hosts"
80 And I doubleclick "linux-server1"
81 Then "Selected hosts" should have option "linux-server1"
82 When I check "Include pie charts"
83 And I check "Include trends graph"
84 And I click "Show report"
85 Then I should see "Host details for linux-server1"
86 And I should see "Selected services"
87 And I shouldn't see "Selected hosts"
88 And I should see "PING"
89 And I shouldn't see "linux-server2"
90 And I shouldn't see "win-server1"
91 And I should see "Group availability (Worst state)"
92 And I shouldn't see "Total Alerts"
93 When I click "Alert histogram"
94 Then I should see "Alert histogram"
95 And I should see "linux-server1"
97 @configuration @asmonitor @reports
98 Scenario: Generate multi host report
99 Given I am on the Host details page
100 And I hover over the "Reporting" button
101 When I click "Availability"
102 And I select "Hosts" from "Report type"
103 And I select "linux-server1" from "Available hosts"
104 And I doubleclick "linux-server1"
105 And I select "win-server1" from "Available hosts"
106 And I doubleclick "win-server1"
107 Then "Selected hosts" should have option "linux-server1"
108 And "Selected hosts" should have option "win-server1"
109 When I check "Include pie charts"
110 And I check "Include trends graph"
111 And I click "Show report"
112 Then I should see "Host state breakdown"
113 And I should see "Selected hosts"
114 And I shouldn't see "Selected services"
115 And I should see "linux-server1"
116 And I should see "win-server1"
117 And I shouldn't see "linux-server2"
118 And I shouldn't see "win-server2"
119 And I should see "Group availability (Worst state)"
120 And I should see "Summary of selected"
121 And I shouldn't see "Total summary"
122 When I click "linux-server1"
123 Then I should see "Host details for linux-server1"
125 @configuration @asmonitor @reports
126 Scenario: Generate single service report
127 Given I am on the Host details page
128 And I hover over the "Reporting" button
129 When I click "Availability"
130 And I select "Services" from "Report type"
131 And I select "linux-server1;PING" from "Available services"
132 And I doubleclick "linux-server1;PING"
133 Then "Selected services" should have option "linux-server1;PING"
134 When I check "Include pie charts"
135 And I check "Include trends graph"
136 And I click "Show report"
137 Then I should see "Service details for PING on host linux-server1"
138 And I shouldn't see "System Load"
139 And I shouldn't see "win-server"
140 And I shouldn't see "Group availability (Worst state)"
141 And I shouldn't see "Summary"
143 @configuration @asmonitor @reports
144 Scenario: Generate multi service on same host report
145 Given I am on the Host details page
146 And I hover over the "Reporting" button
147 When I click "Availability"
148 And I select "Services" from "Report type"
149 And I select "linux-server1;PING" from "Available services"
150 And I doubleclick "linux-server1;PING"
151 And I select "linux-server1;System Load" from "Available services"
152 And I doubleclick "linux-server1;System Load"
153 Then "Selected services" should have option "linux-server1;PING"
154 And "Selected services" should have option "linux-server1;System Load"
155 When I check "Use alias"
156 And I click "Show report"
157 Then I should see "Service state breakdown"
158 And I should see "Services on host: HALIAS-ls1 (linux-server1)"
159 And I should see "PING"
160 And I should see "System Load"
161 And I shouldn't see "linux-server2"
162 And I shouldn't see "win-server1"
163 And I should see "Group availability (Worst state)"
164 And I should see "Summary of selected"
165 And I shouldn't see "Total summary"
167 Then I should see "Service details for PING on host linux-server1"
169 @configuration @asmonitor @reports
170 Scenario: Generate multi service on different host report
171 Given I am on the Host details page
172 And I hover over the "Reporting" button
173 When I click "Availability"
174 And I select "Services" from "Report type"
175 And I select "linux-server1;PING" from "Available services"
176 And I doubleclick "linux-server1;PING"
177 And I select "linux-server2;System Load" from "Available services"
178 And I doubleclick "linux-server2;System Load"
179 Then "Selected services" should have option "linux-server1;PING"
180 And "Selected services" should have option "linux-server2;System Load"
181 When I check "Include pie charts"
182 And I check "Include trends graph"
183 And I click "Show report"
184 Then I should see "Service state breakdown"
185 And I should see "Services on host: linux-server1"
186 And I should see "PING"
187 And I should see "Services on host: linux-server2"
188 And I should see "System Load"
189 And I shouldn't see "win-server"
190 And I should see "Group availability (Worst state)"
191 And I should see "Summary of selected"
192 And I shouldn't see "Total summary"
193 When I click "linux-server1"
194 Then I should see "Host details for linux-server1"
196 @configuration @asmonitor @reports
197 Scenario: Generate single hostgroup report
198 Given I am on the Host details page
199 And I hover over the "Reporting" button
200 When I click "Availability"
201 And I select "LinuxServers" from "Available hostgroups"
202 And I doubleclick "LinuxServers"
203 Then "Selected hostgroups" should have option "LinuxServers"
204 When I check "Use alias"
205 And I click "Show report"
206 Then I should see "Hostgroup breakdown"
207 And I should see "HGALIAS-ls (LinuxServers)"
208 And I should see "HALIAS-ls1 (linux-server1)"
209 And I should see "HALIAS-ls2 (linux-server2)"
210 And I shouldn't see "win-server1"
211 And I shouldn't see "win-server2"
212 And I shouldn't see "Summary of selected"
213 And I shouldn't see "Total summary"
214 And I should see "Group availability (Worst state)"
216 @configuration @asmonitor @reports
217 Scenario: Generate multi hostgroup report
218 Given I am on the Host details page
219 And I hover over the "Reporting" button
220 When I click "Availability"
221 And I select "LinuxServers" from "Available hostgroups"
222 And I doubleclick "LinuxServers"
223 And I select "WindowsServers" from "Available hostgroups"
224 And I doubleclick "WindowsServers"
225 Then "Selected hostgroups" should have option "LinuxServers"
226 And "Selected hostgroups" should have option "WindowsServers"
227 When I check "Include pie charts"
228 And I check "Include trends graph"
229 And I click "Show report"
230 Then I should see "Hostgroup breakdown"
231 And I should see "Summary of LinuxServers"
232 And I should see "Summary of WindowsServers"
233 And I should see "Total summary"
234 And I should see "linux-server1"
235 And I should see "linux-server2"
236 And I should see "win-server1"
237 And I should see "win-server2"
238 And I should see "Group availability (Worst state)"
240 @configuration @asmonitor @reports
241 Scenario: Generate hostgroup report with overlapping members
242 Given I am on the Host details page
243 And I hover over the "Reporting" button
244 When I click "Availability"
245 And I select "LinuxServers" from "Available hostgroups"
246 And I doubleclick "LinuxServers"
247 And I select "MixedGroup" from "Available hostgroups"
248 And I doubleclick "MixedGroup"
249 Then "Selected hostgroups" should have option "LinuxServers"
250 And "Selected hostgroups" should have option "MixedGroup"
251 When I check "Include pie charts"
252 And I check "Include trends graph"
253 And I click "Show report"
254 Then I should see "Hostgroup breakdown"
255 And I should see "Summary of LinuxServers"
256 And I should see "Summary of MixedGroup"
257 And I should see "Total summary"
258 And I should see "linux-server1"
259 And I should see "linux-server2"
260 And I shouldn't see "win-server1"
261 And I should see "win-server2"
262 And I should see "Group availability (Worst state)"
264 @configuration @asmonitor @reports
265 Scenario: Generate single servicegroup report
266 Given I am on the Host details page
267 And I hover over the "Reporting" button
268 When I click "Availability"
269 And I select "Servicegroups" from "Report type"
270 And I select "pings" from "Available servicegroups"
271 And I doubleclick "pings"
272 Then "Selected servicegroups" should have option "pings"
273 When I check "Use alias"
274 And I click "Show report"
275 Then I should see "Servicegroup breakdown"
276 And I should see "SGALIAS-p (pings)"
277 And I should see "Services on host: HALIAS-ls1 (linux-server1)"
278 And I should see "Services on host: HALIAS-ws1 (win-server1)"
279 And I should see "Services on host: HALIAS-ws2 (win-server2)"
280 And I should see "PING"
281 And I shouldn't see "linux-server2"
282 And I shouldn't see "System Load"
283 And I should see "Group availability (Worst state)"
284 And I shouldn't see "Summary of selected"
285 And I shouldn't see "Summary of all"
286 And I shouldn't see "Including soft states"
288 @configuration @asmonitor @reports
289 Scenario: Generate multi servicegroup report
290 Given I am on the Host details page
291 And I hover over the "Reporting" button
292 When I click "Availability"
293 And I select "Servicegroups" from "Report type"
294 And I select "pings" from "Available servicegroups"
295 And I doubleclick "pings"
296 And I select "empty" from "Available servicegroups"
297 And I doubleclick "empty"
298 Then "Selected servicegroups" should have option "pings"
299 And "Selected servicegroups" should have option "empty"
300 When I check "Include pie charts"
301 And I check "Include trends graph"
302 And I click "Show report"
303 Then I should see "Servicegroup breakdown"
304 And I should see "Summary of pings"
305 And I should see "Summary of empty"
306 And I should see "Total summary"
307 And I should see "Services on host: linux-server1"
308 And I should see "Services on host: win-server1"
309 And I should see "Services on host: win-server2"
310 And I should see "PING"
311 And I shouldn't see "linux-server2"
312 And I shouldn't see "System Load"
313 And I should see "Group availability (Worst state)"
315 @configuration @asmonitor @reports
316 Scenario: Generate report on custom report date
317 Given I am on the Host details page
318 And I hover over the "Reporting" button
319 When I click "Availability"
320 And I select "LinuxServers" from "Available hostgroups"
321 And I doubleclick "LinuxServers"
322 Then "Selected hostgroups" should have option "LinuxServers"
323 When I select "Custom" from "Reporting period"
324 And I enter "2013-01-02" into "Start date"
325 And I enter "23:31" into "time_start"
326 And I enter "2013-04-03" into "End date"
327 And I enter "22:32" into "time_end"
328 And I select "workhours" from "Report time period"
329 When I click "Show report"
330 Then I should see "Hostgroup breakdown"
331 And I should see "Reporting period: 2013-01-02 23:31:00 to 2013-04-03 22:32:00 - workhours"
333 @configuration @asmonitor @reports
334 Scenario: Generate report on custom report date without time specified
335 Given I am on the Host details page
336 And I hover over the "Reporting" button
337 When I click "Availability"
338 And I select "LinuxServers" from "Available hostgroups"
339 And I doubleclick "LinuxServers"
340 Then "Selected hostgroups" should have option "LinuxServers"
341 When I select "Custom" from "Reporting period"
342 And I enter "2013-01-02" into "Start date"
343 And I enter "" into "time_start"
344 And I enter "2013-04-03" into "End date"
345 And I enter "" into "time_end"
346 And I select "workhours" from "Report time period"
347 When I click "Show report"
348 Then I should see "Hostgroup breakdown"
349 And I should see "Reporting period: 2013-01-02 00:00:00 to 2013-04-03 23:59:00 - workhours"
351 @configuration @asmonitor @reports
352 Scenario: Save report with misc options
353 Given I am on the Host details page
354 And I hover over the "Reporting" button
355 When I click "Availability"
356 Then I shouldn't see "Saved reports"
357 #And "Saved reports" shouldn't have option "saved test report"
358 When I select "LinuxServers" from "Available hostgroups"
359 And I doubleclick "LinuxServers"
360 Then "Selected hostgroups" should have option "LinuxServers"
361 # Toggle *everything*!
362 When I select "Last month" from "Reporting period"
363 And I select "workhours" from "Report time period"
365 And I select "Average" from "SLA calculation method"
366 And I select "Uptime, with difference" from "Count scheduled downtime as"
367 And I select "Undetermined" from "Count program downtime as"
368 And I check "Include soft states"
369 And I check "Use alias"
370 And I check "Include trends graph"
371 And I check "Include pie charts"
372 And I select "pink_n_fluffy" from "Skin"
373 And I enter "This is a saved test report" into "Description"
374 And I click "Show report"
375 # I don't care where, but I want everything to be visible somehow
376 Then I should see "Last month"
377 And I should see "workhours"
378 And I should see "Showing hosts in state: up, unreachable, pending"
379 And I should see "Average"
380 And I shouldn't see "SLA"
381 And I shouldn't see "Worst"
382 And I should see "Uptime, with difference"
383 And I shouldn't see "Counting program downtime"
384 And I should see "Including soft states"
385 And I should see "HALIAS-ls1"
386 And I should see "HALIAS-ls2"
387 And I should see "HGALIAS-ls"
388 And I should see "This is a saved test report"
389 When I click "Save report"
390 And I enter "saved test report" into "report_name"
391 And I click "Save report" inside "#save_report_form"
392 Then I should see "Report was successfully saved"
394 @configuration @asmonitor @reports
395 Scenario: View saved report
396 Given I am on the Host details page
397 When I hover over the "Reporting" button
398 And I click "Availability"
399 Then I should see "Saved reports"
400 And "Saved reports" should have option "saved test report"
401 When I select "saved test report" from "Saved reports"
402 Then "Selected hostgroups" should have option "LinuxServers"
403 And "Last month" should be selected from "Reporting period"
404 And "workhours" should be selected from "Report time period"
405 And "Down" should be checked
406 And "Average" should be selected from "SLA calculation method"
407 And "Uptime, with difference" should be selected from "Count scheduled downtime as"
408 And "Undetermined" should be selected from "Count program downtime as"
409 And "Include soft states" should be checked
410 And "Use alias" should be checked
411 And "Include trends graph" should be checked
412 And "Include pie charts" should be checked
413 And "pink_n_fluffy" should be selected from "Skin"
414 And "Description" should contain "This is a saved test report"
415 When I click "Show report"
416 Then I should see "Last month"
417 And I should see "workhours"
418 And I should see "Showing hosts in state: up, unreachable, pending"
419 And I should see "Average"
420 And I shouldn't see "SLA"
421 And I shouldn't see "Best"
422 And I should see "Uptime, with difference"
423 And I shouldn't see "Counting program downtime"
424 And I should see "Including soft states"
425 And I should see "HALIAS-ls1"
426 And I should see "HALIAS-ls2"
427 And I should see "HGALIAS-ls"
428 And I should see "This is a saved test report"
430 @configuration @asmonitor @reports @bug-7646
431 Scenario: Uncheck saved checkbox
432 Given I am on the Host details page
433 When I hover over the "Reporting" button
434 And I click "Availability"
435 Then I should see "Saved reports"
436 And "Saved reports" should have option "saved test report"
437 When I select "saved test report" from "Saved reports"
438 Then "Selected hostgroups" should have option "LinuxServers"
439 And "Include soft states" should be checked
440 And "Use alias" should be checked
441 When I uncheck "Include soft states"
442 And I click "Show report"
443 Then I shouldn't see button "Show report"
444 When I click "Edit settings"
445 Then "Include soft states" should be unchecked
446 And "Use alias" should be checked
447 When I uncheck "Use alias"
448 And I wait for 1 second
449 And I click "Show report"
450 Then I shouldn't see button "Show report"
451 And I click "Edit settings"
452 Then "Include soft states" should be unchecked
453 And "Use alias" should be unchecked
454 And I wait for 1 second
455 When I click "Show report"
456 Then I shouldn't see button "Show report"
457 And I click "Save report"
458 And I click "Save report" inside "#save_report_form"
459 Then I should see "Report was successfully saved"
460 When I hover over the "Reporting" button
461 And I click "Availability"
462 Then I should see "Saved reports"
463 And "Saved reports" should have option "saved test report"
464 When I select "saved test report" from "Saved reports"
465 Then "Selected hostgroups" should have option "LinuxServers"
466 And "Include soft states" should be unchecked
467 And "Use alias" should be unchecked
469 @configuration @asmonitor @reports
470 Scenario: Delete previously created report
471 Given I am on the Host details page
472 And I hover over the "Reporting" button
473 When I click "Availability"
474 Then I should see "Saved reports"
475 And "Saved reports" should have option "saved test report"
476 When I select "saved test report"
477 Then "Selected hostgroups" should have option "LinuxServers"
478 When I click "Delete"
479 # Test available first, to force capybara to wait for page reload
480 Then "Available hostgroups" should have option "LinuxServers"
481 And "Saved reports" shouldn't have option "saved test report"
482 And "Selected hostgroups" shouldn't have option "LinuxServers"