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"
94 @configuration @asmonitor @reports
95 Scenario: Generate multi host report
96 Given I am on the Host details page
97 And I hover over the "Reporting" button
98 When I click "Availability"
99 And I select "Hosts" from "Report type"
100 And I select "linux-server1" from "Available hosts"
101 And I doubleclick "linux-server1"
102 And I select "win-server1" from "Available hosts"
103 And I doubleclick "win-server1"
104 Then "Selected hosts" should have option "linux-server1"
105 And "Selected hosts" should have option "win-server1"
106 When I check "Include pie charts"
107 And I check "Include trends graph"
108 And I click "Show report"
109 Then I should see "Host state breakdown"
110 And I should see "Selected hosts"
111 And I shouldn't see "Selected services"
112 And I should see "linux-server1"
113 And I should see "win-server1"
114 And I shouldn't see "linux-server2"
115 And I shouldn't see "win-server2"
116 And I should see "Group availability (Worst state)"
117 And I should see "Summary of selected"
118 And I shouldn't see "Total summary"
120 @configuration @asmonitor @reports
121 Scenario: Generate single service report
122 Given I am on the Host details page
123 And I hover over the "Reporting" button
124 When I click "Availability"
125 And I select "Services" from "Report type"
126 And I select "linux-server1;PING" from "Available services"
127 And I doubleclick "linux-server1;PING"
128 Then "Selected services" should have option "linux-server1;PING"
129 When I check "Include pie charts"
130 And I check "Include trends graph"
131 And I click "Show report"
132 Then I should see "Service details for PING on host linux-server1"
133 And I shouldn't see "System Load"
134 And I shouldn't see "win-server"
135 And I shouldn't see "Group availability (Worst state)"
136 And I shouldn't see "Summary"
138 @configuration @asmonitor @reports
139 Scenario: Generate multi service on same host report
140 Given I am on the Host details page
141 And I hover over the "Reporting" button
142 When I click "Availability"
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 And I select "linux-server1;System Load" from "Available services"
147 And I doubleclick "linux-server1;System Load"
148 Then "Selected services" should have option "linux-server1;PING"
149 And "Selected services" should have option "linux-server1;System Load"
150 When I check "Use alias"
151 And I click "Show report"
152 Then I should see "Service state breakdown"
153 And I should see "Services on host: HALIAS-ls1 (linux-server1)"
154 And I should see "PING"
155 And I should see "System Load"
156 And I shouldn't see "linux-server2"
157 And I shouldn't see "win-server1"
158 And I should see "Group availability (Worst state)"
159 And I should see "Summary of selected"
160 And I shouldn't see "Total summary"
162 @configuration @asmonitor @reports
163 Scenario: Generate multi service on different host report
164 Given I am on the Host details page
165 And I hover over the "Reporting" button
166 When I click "Availability"
167 And I select "Services" from "Report type"
168 And I select "linux-server1;PING" from "Available services"
169 And I doubleclick "linux-server1;PING"
170 And I select "linux-server2;System Load" from "Available services"
171 And I doubleclick "linux-server2;System Load"
172 Then "Selected services" should have option "linux-server1;PING"
173 And "Selected services" should have option "linux-server2;System Load"
174 When I check "Include pie charts"
175 And I check "Include trends graph"
176 And I click "Show report"
177 Then I should see "Service state breakdown"
178 And I should see "Services on host: linux-server1"
179 And I should see "PING"
180 And I should see "Services on host: linux-server2"
181 And I should see "System Load"
182 And I shouldn't see "win-server"
183 And I should see "Group availability (Worst state)"
184 And I should see "Summary of selected"
185 And I shouldn't see "Total summary"
187 @configuration @asmonitor @reports
188 Scenario: Generate single hostgroup report
189 Given I am on the Host details page
190 And I hover over the "Reporting" button
191 When I click "Availability"
192 And I select "LinuxServers" from "Available hostgroups"
193 And I doubleclick "LinuxServers"
194 Then "Selected hostgroups" should have option "LinuxServers"
195 When I check "Use alias"
196 And I click "Show report"
197 Then I should see "Hostgroup breakdown"
198 And I should see "HGALIAS-ls (LinuxServers)"
199 And I should see "HALIAS-ls1 (linux-server1)"
200 And I should see "HALIAS-ls2 (linux-server2)"
201 And I shouldn't see "win-server1"
202 And I shouldn't see "win-server2"
203 And I shouldn't see "Summary of selected"
204 And I shouldn't see "Total summary"
205 And I should see "Group availability (Worst state)"
207 @configuration @asmonitor @reports
208 Scenario: Generate multi hostgroup report
209 Given I am on the Host details page
210 And I hover over the "Reporting" button
211 When I click "Availability"
212 And I select "LinuxServers" from "Available hostgroups"
213 And I doubleclick "LinuxServers"
214 And I select "WindowsServers" from "Available hostgroups"
215 And I doubleclick "WindowsServers"
216 Then "Selected hostgroups" should have option "LinuxServers"
217 And "Selected hostgroups" should have option "WindowsServers"
218 When I check "Include pie charts"
219 And I check "Include trends graph"
220 And I click "Show report"
221 Then I should see "Hostgroup breakdown"
222 And I should see "Summary of LinuxServers"
223 And I should see "Summary of WindowsServers"
224 And I should see "Total summary"
225 And I should see "linux-server1"
226 And I should see "linux-server2"
227 And I should see "win-server1"
228 And I should see "win-server2"
229 And I should see "Group availability (Worst state)"
231 @configuration @asmonitor @reports
232 Scenario: Generate hostgroup report with overlapping members
233 Given I am on the Host details page
234 And I hover over the "Reporting" button
235 When I click "Availability"
236 And I select "LinuxServers" from "Available hostgroups"
237 And I doubleclick "LinuxServers"
238 And I select "MixedGroup" from "Available hostgroups"
239 And I doubleclick "MixedGroup"
240 Then "Selected hostgroups" should have option "LinuxServers"
241 And "Selected hostgroups" should have option "MixedGroup"
242 When I check "Include pie charts"
243 And I check "Include trends graph"
244 And I click "Show report"
245 Then I should see "Hostgroup breakdown"
246 And I should see "Summary of LinuxServers"
247 And I should see "Summary of MixedGroup"
248 And I should see "Total summary"
249 And I should see "linux-server1"
250 And I should see "linux-server2"
251 And I shouldn't see "win-server1"
252 And I should see "win-server2"
253 And I should see "Group availability (Worst state)"
255 @configuration @asmonitor @reports
256 Scenario: Generate single servicegroup report
257 Given I am on the Host details page
258 And I hover over the "Reporting" button
259 When I click "Availability"
260 And I select "Servicegroups" from "Report type"
261 And I select "pings" from "Available servicegroups"
262 And I doubleclick "pings"
263 Then "Selected servicegroups" should have option "pings"
264 When I check "Use alias"
265 And I click "Show report"
266 Then I should see "Servicegroup breakdown"
267 And I should see "SGALIAS-p (pings)"
268 And I should see "Services on host: HALIAS-ls1 (linux-server1)"
269 And I should see "Services on host: HALIAS-ws1 (win-server1)"
270 And I should see "Services on host: HALIAS-ws2 (win-server2)"
271 And I should see "PING"
272 And I shouldn't see "linux-server2"
273 And I shouldn't see "System Load"
274 And I should see "Group availability (Worst state)"
275 And I shouldn't see "Summary of selected"
276 And I shouldn't see "Summary of all"
277 And I shouldn't see "Including soft states"
279 @configuration @asmonitor @reports
280 Scenario: Generate multi servicegroup report
281 Given I am on the Host details page
282 And I hover over the "Reporting" button
283 When I click "Availability"
284 And I select "Servicegroups" from "Report type"
285 And I select "pings" from "Available servicegroups"
286 And I doubleclick "pings"
287 And I select "empty" from "Available servicegroups"
288 And I doubleclick "empty"
289 Then "Selected servicegroups" should have option "pings"
290 And "Selected servicegroups" should have option "empty"
291 When I check "Include pie charts"
292 And I check "Include trends graph"
293 And I click "Show report"
294 Then I should see "Servicegroup breakdown"
295 And I should see "Summary of pings"
296 And I should see "Summary of empty"
297 And I should see "Total summary"
298 And I should see "Services on host: linux-server1"
299 And I should see "Services on host: win-server1"
300 And I should see "Services on host: win-server2"
301 And I should see "PING"
302 And I shouldn't see "linux-server2"
303 And I shouldn't see "System Load"
304 And I should see "Group availability (Worst state)"
306 @configuration @asmonitor @reports
307 Scenario: Generate report on custom report date
308 Given I am on the Host details page
309 And I hover over the "Reporting" button
310 When I click "Availability"
311 And I select "LinuxServers" from "Available hostgroups"
312 And I doubleclick "LinuxServers"
313 Then "Selected hostgroups" should have option "LinuxServers"
314 When I select "Custom" from "Reporting period"
315 And I enter "2013-01-02" into "Start date"
316 And I enter "23:31" into "time_start"
317 And I enter "2013-04-03" into "End date"
318 And I enter "22:32" into "time_end"
319 And I select "workhours" from "Report time period"
320 When I click "Show report"
321 Then I should see "Hostgroup breakdown"
322 And I should see "Reporting period: 2013-01-02 23:31:00 to 2013-04-03 22:32:00 - workhours"
324 @configuration @asmonitor @reports
325 Scenario: Generate report on custom report date without time specified
326 Given I am on the Host details page
327 And I hover over the "Reporting" button
328 When I click "Availability"
329 And I select "LinuxServers" from "Available hostgroups"
330 And I doubleclick "LinuxServers"
331 Then "Selected hostgroups" should have option "LinuxServers"
332 When I select "Custom" from "Reporting period"
333 And I enter "2013-01-02" into "Start date"
334 And I enter "" into "time_start"
335 And I enter "2013-04-03" into "End date"
336 And I enter "" into "time_end"
337 And I select "workhours" from "Report time period"
338 When I click "Show report"
339 Then I should see "Hostgroup breakdown"
340 And I should see "Reporting period: 2013-01-02 00:00:00 to 2013-04-03 23:59:00 - workhours"
342 @configuration @asmonitor @reports
343 Scenario: Save report with misc options
344 Given I am on the Host details page
345 And I hover over the "Reporting" button
346 When I click "Availability"
347 Then I shouldn't see "Saved reports"
348 #And "Saved reports" shouldn't have option "saved test report"
349 When I select "LinuxServers" from "Available hostgroups"
350 And I doubleclick "LinuxServers"
351 Then "Selected hostgroups" should have option "LinuxServers"
352 # Toggle *everything*!
353 When I select "Last month" from "Reporting period"
354 And I select "workhours" from "Report time period"
356 And I select "Average" from "SLA calculation method"
357 And I select "Uptime, with difference" from "Count scheduled downtime as"
358 And I select "Undetermined" from "Count program downtime as"
359 And I check "Include soft states"
360 And I check "Use alias"
361 And I check "Include trends graph"
362 And I check "Include pie charts"
363 And I select "pink_n_fluffy" from "Skin"
364 And I enter "This is a saved test report" into "Description"
365 And I click "Show report"
366 # I don't care where, but I want everything to be visible somehow
367 Then I should see "Last month"
368 And I should see "workhours"
369 And I should see "Showing hosts in state: up, unreachable, pending"
370 And I should see "Average"
371 And I shouldn't see "SLA"
372 And I shouldn't see "Worst"
373 And I should see "Uptime, with difference"
374 And I shouldn't see "Counting program downtime"
375 And I should see "Including soft states"
376 And I should see "HALIAS-ls1"
377 And I should see "HALIAS-ls2"
378 And I should see "HGALIAS-ls"
379 And I should see "This is a saved test report"
380 When I click "Save report"
381 And I enter "saved test report" into "report_name"
382 And I click "Save report" inside "#save_report_form"
383 Then I should see "Report was successfully saved"
385 @configuration @asmonitor @reports
386 Scenario: View saved report
387 Given I am on the Host details page
388 When I hover over the "Reporting" button
389 And I click "Availability"
390 Then I should see "Saved reports"
391 And "Saved reports" should have option "saved test report"
392 When I select "saved test report" from "Saved reports"
393 Then "Selected hostgroups" should have option "LinuxServers"
394 And "Last month" should be selected from "Reporting period"
395 And "workhours" should be selected from "Report time period"
396 And "Down" should be checked
397 And "Average" should be selected from "SLA calculation method"
398 And "Uptime, with difference" should be selected from "Count scheduled downtime as"
399 And "Undetermined" should be selected from "Count program downtime as"
400 And "Include soft states" should be checked
401 And "Use alias" should be checked
402 And "Include trends graph" should be checked
403 And "Include pie charts" should be checked
404 And "pink_n_fluffy" should be selected from "Skin"
405 And "Description" should contain "This is a saved test report"
406 When I click "Show report"
407 Then I should see "Last month"
408 And I should see "workhours"
409 And I should see "Showing hosts in state: up, unreachable, pending"
410 And I should see "Average"
411 And I shouldn't see "SLA"
412 And I shouldn't see "Best"
413 And I should see "Uptime, with difference"
414 And I shouldn't see "Counting program downtime"
415 And I should see "Including soft states"
416 And I should see "HALIAS-ls1"
417 And I should see "HALIAS-ls2"
418 And I should see "HGALIAS-ls"
419 And I should see "This is a saved test report"
421 @configuration @asmonitor @reports @bug-7646
422 Scenario: Uncheck saved checkbox
423 Given I am on the Host details page
424 When I hover over the "Reporting" button
425 And I click "Availability"
426 Then I should see "Saved reports"
427 And "Saved reports" should have option "saved test report"
428 When I select "saved test report" from "Saved reports"
429 Then "Selected hostgroups" should have option "LinuxServers"
430 And "Include soft states" should be checked
431 And "Use alias" should be checked
432 When I uncheck "Include soft states"
433 And I click "Show report"
434 Then I shouldn't see button "Show report"
435 When I click "Edit settings"
436 Then "Include soft states" should be unchecked
437 And "Use alias" should be checked
438 When I uncheck "Use alias"
439 And I wait for 1 second
440 And I click "Show report"
441 Then I shouldn't see button "Show report"
442 And I click "Edit settings"
443 Then "Include soft states" should be unchecked
444 And "Use alias" should be unchecked
445 And I wait for 1 second
446 When I click "Show report"
447 Then I shouldn't see button "Show report"
448 And I click "Save report"
449 And I click "Save report" inside "#save_report_form"
450 Then I should see "Report was successfully saved"
451 When I hover over the "Reporting" button
452 And I click "Availability"
453 Then I should see "Saved reports"
454 And "Saved reports" should have option "saved test report"
455 When I select "saved test report" from "Saved reports"
456 Then "Selected hostgroups" should have option "LinuxServers"
457 And "Include soft states" should be unchecked
458 And "Use alias" should be unchecked
460 @configuration @asmonitor @reports
461 Scenario: Delete previously created report
462 Given I am on the Host details page
463 And I hover over the "Reporting" button
464 When I click "Availability"
465 Then I should see "Saved reports"
466 And "Saved reports" should have option "saved test report"
467 When I select "saved test report"
468 Then "Selected hostgroups" should have option "LinuxServers"
469 When I click "Delete"
470 # Test available first, to force capybara to wait for page reload
471 Then "Available hostgroups" should have option "LinuxServers"
472 And "Saved reports" shouldn't have option "saved test report"
473 And "Selected hostgroups" shouldn't have option "LinuxServers"