1 Feature: Histogram reports
3 Given I have these hostgroups configured:
9 And I have these hosts:
10 | host_name | host_groups |
11 | linux-server1 | LinuxServers,MixedGroup |
12 | linux-server2 | LinuxServers |
13 | win-server1 | WindowsServers |
14 | win-server2 | WindowsServers,MixedGroup |
15 And I have these servicegroups:
16 | servicegroup_name | alias |
17 | pings | ping services plus one non-ping |
18 | empty | nothing in here |
19 And I have these services:
20 | service_description | host_name | check_command | notifications_enabled | active_checks_enabled | service_groups |
21 | System Load | linux-server1 | check_nrpe!load | 1 | 1 | |
22 | PING | linux-server1 | check_ping | 1 | 0 | pings |
23 | System Load | linux-server2 | check_nrpe!load | 1 | 1 | |
24 | PING | win-server1 | check_ping | 1 | 0 | pings |
25 | Swap Usage | win-server1 | check_swap | 1 | 0 | pings |
26 | PING | win-server2 | check_ping | 0 | 1 | pings |
27 And I have these report data entries:
28 | timestamp | event_type | flags | attrib | host_name | service_description | state | hard | retry | downtime_depth | output |
29 | 2013-01-01 12:00:00 | 100 | NULL | NULL | | | 0 | 0 | 0 | NULL | NULL |
30 | 2013-01-01 12:00:01 | 801 | NULL | NULL | win-server1 | | 0 | 1 | 1 | NULL | OK - laa-laa |
31 | 2013-01-01 12:00:02 | 801 | NULL | NULL | linux-server1 | | 0 | 1 | 1 | NULL | OK - Sven Melander |
32 | 2013-01-01 12:00:03 | 701 | NULL | NULL | win-server1 | PING | 0 | 1 | 1 | NULL | OK - po |
33 | 2013-01-01 12:00:04 | 701 | NULL | NULL | win-server1 | PING | 2 | 0 | 1 | NULL | ERROR - tinky-winky |
34 | 2013-01-01 12:00:05 | 701 | NULL | NULL | win-server1 | Swap Usage | 3 | 0 | 1 | NULL | UNKNOWN - out of teletubbies |
35 | 2013-01-01 12:00:02 | 801 | NULL | NULL | linux-server2 | | 0 | 1 | 1 | NULL | PRETTY OK - Jon Skolmen |
36 And I have activated the configuration
39 @configuration @asmonitor
40 Scenario: Generate empty report
41 Given I am on the Host details page
42 And I hover over the "Reporting" button
43 When I click "Histogram"
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 "Histogram"
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 "Histogram"
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 "Histogram"
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 select "Hard states" from "State types to graph"
83 And I select "Day of month" from "Statistics breakdown"
84 And I select "This year" from "Reporting period"
85 And I click "Show report"
86 Then I should see "Alert histogram"
87 And I should see "Included hosts"
88 And I should see "linux-server1"
89 And I shouldn't see "win-server1"
91 @configuration @asmonitor @reports
92 Scenario: Generate multi host report
93 Given I am on the Host details page
94 And I hover over the "Reporting" button
95 When I click "Histogram"
96 And I select "Hosts" from "Report type"
97 And I select "linux-server1" from "Available hosts"
98 And I doubleclick "linux-server1"
99 And I select "win-server1" from "Available hosts"
100 And I doubleclick "win-server1"
101 Then "Selected hosts" should have option "linux-server1"
102 And "Selected hosts" should have option "win-server1"
103 When I select "Monthly" from "Statistics breakdown"
104 And I click "Show report"
105 Then I should see "Alert histogram"
106 And I should see "Included hosts"
107 And I should see "linux-server1"
108 And I should see "win-server1"
110 @configuration @asmonitor @reports
111 Scenario: Generate single service report
112 Given I am on the Host details page
113 And I hover over the "Reporting" button
114 When I click "Histogram"
115 And I select "Services" from "Report type"
116 And I select "linux-server1;PING" from "Available services"
117 And I doubleclick "linux-server1;PING"
118 Then "Selected services" should have option "linux-server1;PING"
119 When I click "Show report"
120 Then I should see "Alert histogram"
121 And I should see "Included services"
122 And I should see "linux-server1;PING"
123 And I shouldn't see "win-server1"
125 @configuration @asmonitor @reports
126 Scenario: Generate multi service on same host report
127 Given I am on the Host details page
128 And I hover over the "Reporting" button
129 When I click "Histogram"
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 And I select "linux-server1;System Load" from "Available services"
134 And I doubleclick "linux-server1;System Load"
135 Then "Selected services" should have option "linux-server1;PING"
136 And "Selected services" should have option "linux-server1;System Load"
137 When I select "Day of week" from "Statistics breakdown"
138 And I check "Ignore repeated states"
139 And I click "Show report"
140 Then I should see "Alert histogram"
141 And I should see "Included services"
142 And I should see "linux-server1;PING"
143 And I should see "linux-server1;System Load"
144 And I shouldn't see "linux-server2"
145 And I shouldn't see "win-server1"
147 @configuration @asmonitor @reports
148 Scenario: Generate multi service on different host report
149 Given I am on the Host details page
150 And I hover over the "Reporting" button
151 When I click "Histogram"
152 And I select "Services" from "Report type"
153 And I select "linux-server1;PING" from "Available services"
154 And I doubleclick "linux-server1;PING"
155 And I select "linux-server2;System Load" from "Available services"
156 And I doubleclick "linux-server2;System Load"
157 Then "Selected services" should have option "linux-server1;PING"
158 And "Selected services" should have option "linux-server2;System Load"
159 When I click "Show report"
160 Then I should see "Alert histogram"
161 And I should see "Included services"
162 And I should see "linux-server1;PING"
163 And I should see "linux-server2;System Load"
165 @configuration @asmonitor @reports
166 Scenario: Generate single hostgroup report
167 Given I am on the Host details page
168 And I hover over the "Reporting" button
169 When I click "Histogram"
170 And I select "LinuxServers" from "Available hostgroups"
171 And I doubleclick "LinuxServers"
172 Then "Selected hostgroups" should have option "LinuxServers"
173 When I click "Show report"
174 Then I should see "Alert histogram"
175 And I should see "Included hosts"
176 And I should see "linux-server1"
177 And I should see "linux-server2"
179 @configuration @asmonitor @reports
180 Scenario: Generate multi hostgroup report
181 Given I am on the Host details page
182 And I hover over the "Reporting" button
183 When I click "Histogram"
184 And I select "LinuxServers" from "Available hostgroups"
185 And I doubleclick "LinuxServers"
186 And I select "WindowsServers" from "Available hostgroups"
187 And I doubleclick "WindowsServers"
188 Then "Selected hostgroups" should have option "LinuxServers"
189 And "Selected hostgroups" should have option "WindowsServers"
190 When I click "Show report"
191 Then I should see "Alert histogram"
192 And I should see "Included hosts"
193 And I should see "linux-server1"
194 And I should see "linux-server2"
195 And I should see "win-server1"
197 @configuration @asmonitor @reports
198 Scenario: Generate hostgroup report with overlapping members
199 Given I am on the Host details page
200 And I hover over the "Reporting" button
201 When I click "Histogram"
202 And I select "LinuxServers" from "Available hostgroups"
203 And I doubleclick "LinuxServers"
204 And I select "MixedGroup" from "Available hostgroups"
205 And I doubleclick "MixedGroup"
206 Then "Selected hostgroups" should have option "LinuxServers"
207 And "Selected hostgroups" should have option "MixedGroup"
208 When I click "Show report"
209 Then I should see "Alert histogram"
210 And I should see "Included hosts"
211 And I should see "linux-server1"
212 And I should see "linux-server2"
213 And I shouldn't see "win-server1"
215 @configuration @asmonitor @reports
216 Scenario: Generate single servicegroup report
217 Given I am on the Host details page
218 And I hover over the "Reporting" button
219 When I click "Histogram"
220 And I select "Servicegroups" from "Report type"
221 And I select "pings" from "Available servicegroups"
222 And I doubleclick "pings"
223 Then "Selected servicegroups" should have option "pings"
224 When I click "Show report"
225 Then I should see "Alert histogram"
226 And I should see "Included services"
227 And I should see "linux-server1;PING"
229 @configuration @asmonitor @reports
230 Scenario: Generate multi servicegroup report
231 Given I am on the Host details page
232 And I hover over the "Reporting" button
233 When I click "Histogram"
234 And I select "Servicegroups" from "Report type"
235 And I select "pings" from "Available servicegroups"
236 And I doubleclick "pings"
237 And I select "empty" from "Available servicegroups"
238 And I doubleclick "empty"
239 Then "Selected servicegroups" should have option "pings"
240 And "Selected servicegroups" should have option "empty"
241 When I click "Show report"
242 Then I should see "Alert histogram"
243 And I should see "Included services"
244 And I should see "linux-server1;PING"
246 @configuration @asmonitor @reports
247 Scenario: Generate report on custom report date
248 Given I am on the Host details page
249 And I hover over the "Reporting" button
250 When I click "Histogram"
251 And I select "LinuxServers" from "Available hostgroups"
252 And I doubleclick "LinuxServers"
253 Then "Selected hostgroups" should have option "LinuxServers"
254 When I select "Custom" from "Reporting period"
255 And I enter "2013-01-02" into "Start date"
256 And I enter "23:31" into "time_start"
257 And I enter "2013-04-03" into "End date"
258 And I enter "22:32" into "time_end"
259 When I click "Show report"
260 Then I should see "Alert histogram"
261 And I should see "Reporting period: 2013-01-02 23:31:00 to 2013-04-03 22:32:00"
263 @configuration @asmonitor @reports
264 Scenario: Generate report on custom report date without time specified
265 Given I am on the Host details page
266 And I hover over the "Reporting" button
267 When I click "Histogram"
268 And I select "LinuxServers" from "Available hostgroups"
269 And I doubleclick "LinuxServers"
270 Then "Selected hostgroups" should have option "LinuxServers"
271 When I select "Custom" from "Reporting period"
272 And I enter "2013-01-02" into "Start date"
273 And I enter "" into "time_start"
274 And I enter "2013-04-03" into "End date"
275 And I enter "" into "time_end"
276 When I click "Show report"
277 Then I should see "Alert histogram"
278 And I should see "Reporting period: 2013-01-02 00:00:00 to 2013-04-03 23:59:00"
280 @configuration @asmonitor @reports
281 Scenario: Save report
282 Given I am on the Host details page
283 And I hover over the "Reporting" button
284 When I click "Histogram"
285 Then I shouldn't see "Saved reports"
286 #And "Saved reports" shouldn't have option "saved test report"
287 When I select "LinuxServers" from "Available hostgroups"
288 And I doubleclick "LinuxServers"
289 Then "Selected hostgroups" should have option "LinuxServers"
290 # Toggle *everything*!
291 When I select "Last month" from "Reporting period"
292 And I select "Day of week" from "Statistics breakdown"
293 And I select "Soft states" from "State types to graph"
294 And I check "Ignore repeated states"
295 And I select "pink_n_fluffy" from "Skin"
296 And I enter "This is a saved test report" into "Description"
297 And I click "Show report"
298 # I don't care where, but I want everything to be visible somehow
299 Then I should see "Last month"
300 And I should see "Alert histogram"
301 And I should see "This is a saved test report"
302 When I click "Save report"
303 And I enter "saved test report" into "report_name"
304 And I click "Save report" inside "#save_report_form"
305 Then I should see "Report was successfully saved"
307 @configuration @asmonitor @reports
308 Scenario: View saved report
309 Given I am on the Host details page
310 When I hover over the "Reporting" button
311 And I click "Histogram"
312 Then I should see "Saved reports"
313 And "Saved reports" should have option "saved test report"
314 When I select "saved test report" from "Saved reports"
315 Then "Selected hostgroups" should have option "LinuxServers"
316 And "Last month" should be selected from "Reporting period"
317 And "Day of week" should be selected from "Statistics breakdown"
318 And "Soft states" should be selected from "State types to graph"
319 And "Ignore repeated states" should be checked
320 And "pink_n_fluffy" should be selected from "Skin"
321 And "Description" should contain "This is a saved test report"
322 When I click "Show report"
323 Then I should see "Last month"
324 And I should see "Alert histogram"
325 And I should see "This is a saved test report"
327 @configuration @asmonitor @reports
328 Scenario: Delete previously created report
329 Given I am on the Host details page
330 And I hover over the "Reporting" button
331 When I click "Histogram"
332 Then I should see "Saved reports"
333 And "Saved reports" should have option "saved test report"
334 When I select "saved test report"
335 Then "Selected hostgroups" should have option "LinuxServers"
336 When I click "Delete"
337 # Test available first, to force capybara to wait for page reload
338 Then "Available hostgroups" should have option "LinuxServers"
339 And "Saved reports" shouldn't have option "saved test report"
340 And "Selected hostgroups" shouldn't have option "LinuxServers"