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