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