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:
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
44 And I enter "9" into "Jan"
45 And I click "Click to propagate this value to all months"
46 And I click "Show report"
47 Then I should see "Please select what objects to base the report on"
48 And I should see "Report Settings"
50 @configuration @asmonitor @reports
51 Scenario: Generate report on empty hostgroup
52 Given I am on the Host details page
53 And I hover over the "Reporting" button
55 And I select "EmptyGroup" from "Available hostgroups"
56 And I doubleclick "EmptyGroup"
57 Then "Selected hostgroups" should have option "EmptyGroup"
58 When I enter "9" into "Jan"
59 And I click "Click to propagate this value to all months"
60 And I click "Show report"
61 Then I should see "The groups you selected (EmptyGroup) had no members, so cannot create a report from them"
62 And I should see "Report Settings"
63 And "Jan" should contain "9"
65 @configuration @asmonitor @reports
66 Scenario: Generate report on empty servicegroup
67 Given I am on the Host details page
68 And I hover over the "Reporting" button
70 And I select "Servicegroups" from "Report type"
71 And I select "empty" from "Available servicegroups"
72 And I doubleclick "empty"
73 Then "Selected servicegroups" should have option "empty"
74 When I enter "9" into "Jan"
75 And I click "Click to propagate this value to all months"
76 And I click "Show report"
77 Then I should see "The groups you selected (empty) had no members, so cannot create a report from them"
78 And I should see "Report Settings"
80 @configuration @asmonitor @reports
81 Scenario: Generate report without SLA values
82 Given I am on the Host details page
83 And I hover over the "Reporting" button
85 And I select "LinuxServers" from "Available hostgroups"
86 And I doubleclick "LinuxServers"
87 Then "Selected hostgroups" should have option "LinuxServers"
88 When I click "Show report"
89 Then I should see "Please enter at least one SLA value"
90 And I should see "Report Settings"
92 @configuration @asmonitor @reports
93 Scenario: Generate single host report
94 Given I am on the Host details page
95 And I hover over the "Reporting" button
97 And I select "Hosts" from "Report type"
98 And I select "linux-server1" from "Available hosts"
99 And I doubleclick "linux-server1"
100 Then "Selected hosts" should have option "linux-server1"
101 When I enter "9" into "Jan"
102 And I click "Click to propagate this value to all months"
103 And I click "Show report"
104 Then I should see "SLA breakdown for: linux-server1"
105 And I shouldn't see "linux-server2"
106 And I shouldn't see "win-server1"
107 When I click "Show availability breakdown"
108 Then I should see "Host details"
109 And I should see "linux-server1"
111 @configuration @asmonitor @reports
112 Scenario: Generate multi host report
113 Given I am on the Host details page
114 And I hover over the "Reporting" button
116 And I select "Hosts" from "Report type"
117 And I select "linux-server1" from "Available hosts"
118 And I doubleclick "linux-server1"
119 And I select "win-server1" from "Available hosts"
120 And I doubleclick "win-server1"
121 Then "Selected hosts" should have option "linux-server1"
122 And "Selected hosts" should have option "win-server1"
123 When I enter "9" into "Jan"
124 And I click "Click to propagate this value to all months"
125 And I click "Show report"
126 Then I should see "SLA breakdown for custom group"
127 And I should see "Group members"
128 And I should see "linux-server1"
129 And I should see "win-server1"
130 And I shouldn't see "linux-server2"
131 And I shouldn't see "win-server2"
132 And I should see "9.000 %"
133 When I click "Show availability breakdown"
134 Then I should see "Host state breakdown"
135 And I should see "linux-server1"
136 And I should see "win-server1"
138 @configuration @asmonitor @reports
139 Scenario: Generate single service report
140 Given I am on the Host details page
141 And I hover over the "Reporting" button
143 And I select "Services" from "Report type"
144 And I select "linux-server1;PING" from "Available services"
145 And I doubleclick "linux-server1;PING"
146 Then "Selected services" should have option "linux-server1;PING"
147 When I enter "9.1" into "Jan"
148 And I click "Click to propagate this value to all months"
149 And I click "Show report"
150 Then I should see "SLA breakdown for: linux-server1;PING"
151 And I shouldn't see "System Load"
152 And I shouldn't see "win-server"
153 And I should see "9.100 %"
154 When I click "Show availability breakdown"
155 Then I should see "Service details for PING on host linux-server1"
157 @configuration @asmonitor @reports
158 Scenario: Generate multi service on same host report
159 Given I am on the Host details page
160 And I hover over the "Reporting" button
162 And I select "Services" from "Report type"
163 And I select "linux-server1;PING" from "Available services"
164 And I doubleclick "linux-server1;PING"
165 And I select "linux-server1;System Load" from "Available services"
166 And I doubleclick "linux-server1;System Load"
167 Then "Selected services" should have option "linux-server1;PING"
168 And "Selected services" should have option "linux-server1;System Load"
169 When I enter "9,1" into "Jan"
170 And I click "Click to propagate this value to all months"
171 And I click "Show report"
172 Then I should see "SLA breakdown for custom group"
173 And I should see "Group members"
174 And I should see "linux-server1;PING"
175 And I should see "linux-server1;System Load"
176 And I shouldn't see "linux-server2"
177 And I shouldn't see "win-server1"
178 And I should see "9.100 %"
179 When I click "Show availability breakdown"
180 Then I should see "Service state breakdown"
181 And I should see "Services on host: linux-server1"
182 And I should see "PING"
183 And I should see "System Load"
185 @configuration @asmonitor @reports
186 Scenario: Generate multi service on different host report
187 Given I am on the Host details page
188 And I hover over the "Reporting" button
190 And I select "Services" from "Report type"
191 And I select "linux-server1;PING" from "Available services"
192 And I doubleclick "linux-server1;PING"
193 And I select "linux-server2;System Load" from "Available services"
194 And I doubleclick "linux-server2;System Load"
195 Then "Selected services" should have option "linux-server1;PING"
196 And "Selected services" should have option "linux-server2;System Load"
197 When I enter "9.99" into "Jan"
198 And I click "Click to propagate this value to all months"
199 And I click "Show report"
200 Then I should see "SLA breakdown for custom group"
201 And I should see "Group members"
202 And I should see "linux-server1;PING"
203 And I should see "linux-server2;System Load"
204 And I shouldn't see "linux-server2;PING"
205 And I shouldn't see "linux-server1;System Load"
206 And I shouldn't see "win-server1"
207 And I should see "9.990 %"
208 When I click "Show availability breakdown"
209 Then I should see "Service state breakdown"
210 And I should see "Services on host: linux-server1"
211 And I should see "Services on host: linux-server2"
212 And I should see "PING"
213 And I should see "System Load"
215 @configuration @asmonitor @reports
216 Scenario: Generate single hostgroup report
217 Given I am on the Host details page
218 And I hover over the "Reporting" button
220 And I select "LinuxServers" from "Available hostgroups"
221 And I doubleclick "LinuxServers"
222 Then "Selected hostgroups" should have option "LinuxServers"
223 When I enter "9,99" into "Jan"
224 And I click "Click to propagate this value to all months"
225 And I click "Show report"
226 Then I should see "SLA breakdown for: LinuxServers"
227 And I should see "Group members"
228 And I should see "linux-server1"
229 And I should see "linux-server2"
230 And I shouldn't see "win-server1"
231 And I shouldn't see "win-server2"
232 And I should see "9.990 %"
233 When I click "Show availability breakdown"
234 Then I should see "Hostgroup breakdown"
235 And I should see "linux-server1"
236 And I should see "linux-server2"
238 @configuration @asmonitor @reports
239 Scenario: Generate multi hostgroup report
240 Given I am on the Host details page
241 And I hover over the "Reporting" button
243 And I select "LinuxServers" from "Available hostgroups"
244 And I doubleclick "LinuxServers"
245 And I select "WindowsServers" from "Available hostgroups"
246 And I doubleclick "WindowsServers"
247 Then "Selected hostgroups" should have option "LinuxServers"
248 And "Selected hostgroups" should have option "WindowsServers"
249 When I enter "99.999" into "Jan"
250 And I click "Click to propagate this value to all months"
251 And I click "Show report"
252 Then I should see "SLA breakdown for: LinuxServers"
253 And I should see "SLA breakdown for: WindowsServers"
254 And I should see "Group members"
255 And I should see "linux-server1"
256 And I should see "linux-server2"
257 And I should see "win-server1"
258 And I should see "win-server2"
259 And I should see "99.999 %"
260 # By pure chance (aka "first match"), this will be the top graph, aka the LinuxServers one
261 When I click "Show availability breakdown"
262 Then I should see "Hostgroup breakdown"
263 And I should see "linux-server1"
264 And I should see "linux-server2"
266 @configuration @asmonitor @reports
267 Scenario: Generate hostgroup report with overlapping members
268 Given I am on the Host details page
269 And I hover over the "Reporting" button
271 And I select "LinuxServers" from "Available hostgroups"
272 And I doubleclick "LinuxServers"
273 And I select "MixedGroup" from "Available hostgroups"
274 And I doubleclick "MixedGroup"
275 Then "Selected hostgroups" should have option "LinuxServers"
276 And "Selected hostgroups" should have option "MixedGroup"
277 When I enter "99,999" into "Jan"
278 And I click "Click to propagate this value to all months"
279 And I click "Show report"
280 Then I should see "SLA breakdown for: LinuxServers"
281 And I should see "SLA breakdown for: MixedGroup"
282 And I should see "Group members"
283 And I should see "linux-server1"
284 And I should see "linux-server2"
285 And I shouldn't see "win-server1"
286 And I should see "win-server2"
287 And I should see "99.999 %"
288 # By pure chance (aka "first match"), this will be the top graph, aka the LinuxServers one
289 When I click "Show availability breakdown"
290 Then I should see "Hostgroup breakdown"
291 And I should see "linux-server1"
292 And I should see "linux-server2"
294 @configuration @asmonitor @reports
295 Scenario: Generate single servicegroup report
296 Given I am on the Host details page
297 And I hover over the "Reporting" button
299 And I select "Servicegroups" from "Report type"
300 And I select "pings" from "Available servicegroups"
301 And I doubleclick "pings"
302 Then "Selected servicegroups" should have option "pings"
303 When I enter "100" into "Jan"
304 And I click "Click to propagate this value to all months"
305 And I click "Show report"
306 Then I should see "SLA breakdown for: pings"
307 And I should see "Group members"
308 And I should see "linux-server1;PING"
309 And I should see "win-server1;PING"
310 And I should see "win-server2;PING"
311 And I shouldn't see "linux-server2"
312 And I shouldn't see "System Load"
313 And I should see "100 %"
314 When I click "Show availability breakdown"
315 Then I should see "Servicegroup breakdown"
316 And I should see "Services on host: linux-server1"
317 And I should see "Services on host: win-server1"
318 And I should see "Services on host: win-server2"
319 And I should see "PING"
321 @configuration @asmonitor @reports
322 Scenario: Generate multi servicegroup report
323 Given I am on the Host details page
324 And I hover over the "Reporting" button
326 And I select "Servicegroups" from "Report type"
327 And I select "pings" from "Available servicegroups"
328 And I doubleclick "pings"
329 And I select "empty" from "Available servicegroups"
330 And I doubleclick "empty"
331 Then "Selected servicegroups" should have option "pings"
332 And "Selected servicegroups" should have option "empty"
333 When I enter "9" into "Jan"
334 And I click "Click to propagate this value to all months"
335 And I click "Show report"
336 Then I should see "SLA breakdown for: pings"
337 And I should see "SLA breakdown for: empty"
338 And I should see "Group members"
339 And I should see "linux-server1;PING"
340 And I should see "win-server1;PING"
341 And I should see "win-server2;PING"
342 And I shouldn't see "linux-server2"
343 And I shouldn't see "System Load"
344 When I click "Show availability breakdown for pings"
345 Then I should see "Servicegroup breakdown"
346 And I should see "Services on host: linux-server1"
347 And I should see "Services on host: win-server1"
348 And I should see "Services on host: win-server2"
349 And I should see "PING"
351 @configuration @asmonitor @reports
352 Scenario: Generate report on custom report date
353 Given I am on the Host details page
354 And I hover over the "Reporting" button
356 And I select "LinuxServers" from "Available hostgroups"
357 And I doubleclick "LinuxServers"
358 Then "Selected hostgroups" should have option "LinuxServers"
359 When I select "Custom" from "Reporting period"
360 And I select "2013" from "Start year"
361 And I select "Jan" from "Start month"
362 And I select "2013" from "End year"
363 And I select "Mar" from "End month"
364 Then "Jan" should be enabled
365 And "Mar" should be enabled
366 And "May" should be disabled
367 And "Dec" should be disabled
368 And I enter "9" into "Jan"
369 And I click "Click to propagate this value to all months"
370 Then "Jan" should contain "9"
371 And "Feb" should contain "9"
372 And "Mar" should contain "9"
373 When I click "Show report"
374 Then I should see "SLA breakdown"
375 And I should see "Reporting period: 2013-01-01 to 2013-03-31 - 24x7"
377 @configuration @asmonitor @reports
378 Scenario: Ensure correct timeperiod is carried over to avail
379 Given I am on the Host details page
380 And I hover over the "Reporting" button
382 And I select "LinuxServers" from "Available hostgroups"
383 And I doubleclick "LinuxServers"
384 Then "Selected hostgroups" should have option "LinuxServers"
385 When I select "Last 12 months" from "Reporting period"
386 And I enter "9" into "Jan"
387 And I click "Click to propagate this value to all months"
388 And I click "Show report"
389 Then I should see "SLA breakdown"
390 And I should see "Reporting period: Last 12 months"
391 When I click "Show availability breakdown"
392 Then I should see "Hostgroup breakdown"
393 And I should see "LinuxServers"
394 And I should see "linux-server1"
395 And I should see "linux-server2"
396 And I shouldn't see "win-server1"
397 And I shouldn't see "win-server2"
398 And I should see "Group availability (Worst state)"
399 And I should see "Reporting period: Last 12 months"
401 @configuration @asmonitor @reports
402 Scenario: Save report with misc options
403 Given I am on the Host details page
404 And I hover over the "Reporting" button
406 Then "Saved reports" shouldn't have option "saved test report"
407 When I select "LinuxServers" from "Available hostgroups"
408 And I doubleclick "LinuxServers"
409 Then "Selected hostgroups" should have option "LinuxServers"
410 # Toggle *everything*!
411 When I select "Last year" from "Reporting period"
412 And I enter "9" into "Jan"
413 And I click "Click to propagate this value to all months"
414 And I select "workhours" from "Report time period"
416 And I select "Average" from "SLA calculation method"
417 And I select "Uptime, with difference" from "Count scheduled downtime as"
418 And I select "Undetermined" from "Count program downtime as"
419 And I check "Include soft states"
420 And I check "Use alias"
421 And I select "pink_n_fluffy" from "Skin"
422 And I enter "This is a saved test report" into "Description"
423 And I click "Show report"
424 # I don't care where, but I want everything to be visible somehow
425 Then I should see "Last year"
426 And I should see "workhours"
427 And I should see "Showing hosts in state: up, unreachable, pending"
428 And I should see "Average"
429 And I should see "Uptime, with difference"
430 And I shouldn't see "Counting program downtime"
431 And I should see "Including soft states"
432 And I should see "HALIAS-ls1"
433 And I should see "HALIAS-ls2"
434 And I should see "HGALIAS-ls"
435 And I should see "This is a saved test report"
436 And I should see "9.000 %"
437 When I click "Save report"
438 And I enter "saved test report" into "report_name"
439 And I click "Save report" inside "#save_report_form"
440 Then I should see "Report was successfully saved"
442 @configuration @asmonitor @reports
443 Scenario: View saved report
444 Given I am on the Host details page
445 When I hover over the "Reporting" button
447 Then I should see "Saved reports"
448 And "Saved reports" should have option "saved test report"
449 When I select "saved test report" from "Saved reports"
450 Then "Selected hostgroups" should have option "LinuxServers"
451 And "Last year" should be selected from "Reporting period"
452 And "workhours" should be selected from "Report time period"
453 And "Down" should be checked
454 And "Average" should be selected from "SLA calculation method"
455 And "Uptime, with difference" should be selected from "Count scheduled downtime as"
456 And "Undetermined" should be selected from "Count program downtime as"
457 And "Include soft states" should be checked
458 And "Use alias" should be checked
459 And "pink_n_fluffy" should be selected from "Skin"
460 And "Description" should contain "This is a saved test report"
461 And "Jan" should contain "9"
462 And "Feb" should contain "9"
463 When I click "Show report"
464 Then I should see "Last year"
465 And I should see "workhours"
466 And I should see "Showing hosts in state: up, unreachable, pending"
467 And I should see "Average"
468 And I should see "Uptime, with difference"
469 And I shouldn't see "Counting program downtime"
470 And I should see "Including soft states"
471 And I should see "HALIAS-ls1"
472 And I should see "HALIAS-ls2"
473 And I should see "HGALIAS-ls"
474 And I should see "This is a saved test report"
475 And I should see "9.000 %"
477 @configuration @asmonitor @reports @bug-7646
478 Scenario: Uncheck saved checkbox
479 Given I am on the Host details page
480 When I hover over the "Reporting" button
482 Then I should see "Saved reports"
483 And "Saved reports" should have option "saved test report"
484 When I select "saved test report" from "Saved reports"
485 Then "Selected hostgroups" should have option "LinuxServers"
486 And "Available hostgroups" should have option "WindowsServers"
487 And "Include soft states" should be checked
488 And "Use alias" should be checked
489 When I select "LinuxServers" from "Selected hostgroups"
490 And I doubleclick "LinuxServers"
491 And I deselect options in "Available hostgroups"
492 And I select "WindowsServers" from "Available hostgroups"
493 And I doubleclick "WindowsServers"
494 Then "Selected hostgroups" shouldn't have option "LinuxServers"
495 And "Available hostgroups" shouldn't have option "WindowsServers"
496 When I uncheck "Include soft states"
497 And I click "Show report"
498 And I click "Edit settings"
499 Then "Include soft states" should be unchecked
500 And "Use alias" should be checked
501 When I uncheck "Use alias"
502 And I click "Show report"
503 And I click "Edit settings"
504 Then "Include soft states" should be unchecked
505 And "Use alias" should be unchecked
506 When I click "Show report"
507 And I click "Save report"
508 And I click "Save report" inside "#save_report_form"
509 Then I should see "Report was successfully saved"
510 When I hover over the "Reporting" button
512 Then I should see "Saved reports"
513 And "Saved reports" should have option "saved test report"
514 When I select "saved test report" from "Saved reports"
515 Then "Available hostgroups" should have option "LinuxServers"
516 Then "Selected hostgroups" should have option "WindowsServers"
517 And "Include soft states" should be unchecked
518 And "Use alias" should be unchecked
520 @configuration @asmonitor @reports
521 Scenario: Delete previously created report
522 Given I am on the Host details page
523 And I hover over the "Reporting" button
525 Then I should see "Saved reports"
526 And "Saved reports" should have option "saved test report"
527 When I select "saved test report"
528 Then "Selected hostgroups" should have option "WindowsServers"
529 When I click "Delete"
530 # Test available first, to force capybara to wait for page reload
531 Then "Available hostgroups" should have option "WindowsServers"
532 And "Saved reports" shouldn't have option "saved test report"
533 And "Selected hostgroups" shouldn't have option "WindowsServers"