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 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 "Histogram"
64 And I select "Servicegroups" from "Report type"
65 And I select "empty" from the multiselect "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 "Histogram"
76 And I select "Hosts" from "Report type"
77 And I select "linux-server1" from the multiselect "objects"
78 Then "objects" should have option "linux-server1"
79 When I select "Hard states" from "State types to graph"
80 And I select "Day of month" from "Statistics breakdown"
81 And I select "This year" from "Reporting period"
82 And I click "Show report"
83 Then I should see "Alert histogram"
84 And I should see "Included hosts"
85 And I should see "linux-server1"
86 And I shouldn't see "win-server1"
88 @configuration @asmonitor @reports
89 Scenario: Generate multi host report
90 Given I am on the Host details page
91 And I hover over the "Reporting" button
92 When I click "Histogram"
93 And I select "Hosts" from "Report type"
94 And I select "linux-server1" from the multiselect "objects"
95 And I select "win-server1" from the multiselect "objects"
96 Then "objects[]" should have option "linux-server1"
97 And "objects[]" should have option "win-server1"
98 When I select "Monthly" from "Statistics breakdown"
99 And I click "Show report"
100 Then I should see "Alert histogram"
101 And I should see "Included hosts"
102 And I should see "linux-server1"
103 And I should see "win-server1"
105 @configuration @asmonitor @reports
106 Scenario: Generate single service report
107 Given I am on the Host details page
108 And I hover over the "Reporting" button
109 When I click "Histogram"
110 And I select "Services" from "Report type"
111 And I select "linux-server1;PING" from the multiselect "objects"
112 Then "objects[]" should have option "linux-server1;PING"
113 When I click "Show report"
114 Then I should see "Alert histogram"
115 And I should see "Included services"
116 And I should see "linux-server1;PING"
117 And I shouldn't see "win-server1"
119 @configuration @asmonitor @reports
120 Scenario: Generate multi service on same host report
121 Given I am on the Host details page
122 And I hover over the "Reporting" button
123 When I click "Histogram"
124 And I select "Services" from "Report type"
125 And I select "linux-server1;PING" from the multiselect "objects"
126 And I select "linux-server1;System Load" from the multiselect "objects"
127 Then "objects[]" should have option "linux-server1;PING"
128 And "objects[]" should have option "linux-server1;System Load"
129 When I select "Day of week" from "Statistics breakdown"
130 And I check "Ignore repeated states"
131 And I click "Show report"
132 Then I should see "Alert histogram"
133 And I should see "Included services"
134 And I should see "linux-server1;PING"
135 And I should see "linux-server1;System Load"
136 And I shouldn't see "linux-server2"
137 And I shouldn't see "win-server1"
139 @configuration @asmonitor @reports
140 Scenario: Generate multi service on different host report
141 Given I am on the Host details page
142 And I hover over the "Reporting" button
143 When I click "Histogram"
144 And I select "Services" from "Report type"
145 And I select "linux-server1;PING" from the multiselect "objects"
146 And I select "linux-server2;System Load" from the multiselect "objects"
147 Then "objects[]" should have option "linux-server1;PING"
148 And "objects[]" should have option "linux-server2;System Load"
149 When I click "Show report"
150 Then I should see "Alert histogram"
151 And I should see "Included services"
152 And I should see "linux-server1;PING"
153 And I should see "linux-server2;System Load"
155 @configuration @asmonitor @reports
156 Scenario: Generate single hostgroup report
157 Given I am on the Host details page
158 And I hover over the "Reporting" button
159 When I click "Histogram"
160 And I select "LinuxServers" from the multiselect "objects"
161 Then "objects[]" should have option "LinuxServers"
162 When I click "Show report"
163 Then I should see "Alert histogram"
164 And I should see "Included hosts"
165 And I should see "linux-server1"
166 And I should see "linux-server2"
168 @configuration @asmonitor @reports
169 Scenario: Generate multi hostgroup report
170 Given I am on the Host details page
171 And I hover over the "Reporting" button
172 When I click "Histogram"
173 And I select "LinuxServers" from the multiselect "objects"
174 And I select "WindowsServers" from the multiselect "objects"
175 Then "objects[]" should have option "LinuxServers"
176 And "objects[]" should have option "WindowsServers"
177 When I click "Show report"
178 Then I should see "Alert histogram"
179 And I should see "Included hosts"
180 And I should see "linux-server1"
181 And I should see "linux-server2"
182 And I should see "win-server1"
184 @configuration @asmonitor @reports
185 Scenario: Generate hostgroup report with overlapping members
186 Given I am on the Host details page
187 And I hover over the "Reporting" button
188 When I click "Histogram"
189 And I select "LinuxServers" from the multiselect "objects"
190 And I select "MixedGroup" from the multiselect "objects"
191 Then "objects[]" should have option "LinuxServers"
192 And "objects[]" should have option "MixedGroup"
193 When I click "Show report"
194 Then I should see "Alert histogram"
195 And I should see "Included hosts"
196 And I should see "linux-server1"
197 And I should see "linux-server2"
198 And I shouldn't see "win-server1"
200 @configuration @asmonitor @reports
201 Scenario: Generate single servicegroup report
202 Given I am on the Host details page
203 And I hover over the "Reporting" button
204 When I click "Histogram"
205 And I select "Servicegroups" from "Report type"
206 And I select "pings" from the multiselect "objects"
207 Then "objects[]" should have option "pings"
208 When I click "Show report"
209 Then I should see "Alert histogram"
210 And I should see "Included services"
211 And I should see "linux-server1;PING"
213 @configuration @asmonitor @reports
214 Scenario: Generate multi servicegroup report
215 Given I am on the Host details page
216 And I hover over the "Reporting" button
217 When I click "Histogram"
218 And I select "Servicegroups" from "Report type"
219 And I select "pings" from the multiselect "objects"
220 And I select "empty" from the multiselect "objects"
221 Then "objects[]" should have option "pings"
222 And "objects[]" should have option "empty"
223 When I click "Show report"
224 Then I should see "Alert histogram"
225 And I should see "Included services"
226 And I should see "linux-server1;PING"
228 @configuration @asmonitor @reports
229 Scenario: Generate report on custom report date
230 Given I am on the Host details page
231 And I hover over the "Reporting" button
232 When I click "Histogram"
233 And I select "LinuxServers" from the multiselect "objects"
234 Then "objects[]" should have option "LinuxServers"
235 When I select "Custom" from "Reporting period"
236 And I enter "2013-01-02" into "Start date"
237 And I enter "23:31" into "time_start"
238 And I enter "2013-04-03" into "End date"
239 And I enter "22:32" into "time_end"
240 When I click "Show report"
241 Then I should see "Alert histogram"
242 And I should see "Reporting period: 2013-01-02 23:31:00 to 2013-04-03 22:32:00"
244 @configuration @asmonitor @reports
245 Scenario: Generate report on custom report date without time specified
246 Given I am on the Host details page
247 And I hover over the "Reporting" button
248 When I click "Histogram"
249 And I select "LinuxServers" from the multiselect "objects"
250 Then "objects[]" should have option "LinuxServers"
251 When I select "Custom" from "Reporting period"
252 And I enter "2013-01-02" into "Start date"
253 And I enter "" into "time_start"
254 And I enter "2013-04-03" into "End date"
255 And I enter "" into "time_end"
256 When I click "Show report"
257 Then I should see "Alert histogram"
258 And I should see "Reporting period: 2013-01-02 00:00:00 to 2013-04-03 23:59:00"
260 @configuration @asmonitor @reports
261 Scenario: Save report
262 Given I am on the Host details page
263 And I hover over the "Reporting" button
264 When I click "Histogram"
265 Then I shouldn't see "Saved reports"
266 #And "Saved reports" shouldn't have option "saved test report"
267 When I select "LinuxServers" from the multiselect "objects"
268 Then "objects[]" should have option "LinuxServers"
269 # Toggle *everything*!
270 When I select "Last month" from "Reporting period"
271 And I select "Day of week" from "Statistics breakdown"
272 And I select "Soft states" from "State types to graph"
273 And I check "Ignore repeated states"
274 And I select "pink_n_fluffy" from "Skin"
275 And I enter "This is a saved test report" into "Description"
276 And I click "Show report"
277 # I don't care where, but I want everything to be visible somehow
278 Then I should see "Last month"
279 And I should see "Alert histogram"
280 And I should see "This is a saved test report"
281 When I click "Save report"
282 And I enter "saved test report" into "report_name"
283 And I click "Save report" inside "#save_report_form"
284 Then I should see "Report was successfully saved"
286 @configuration @asmonitor @reports
287 Scenario: View saved report
288 Given I am on the Host details page
289 When I hover over the "Reporting" button
290 And I click "Histogram"
291 Then I should see "Saved reports"
292 And "Saved reports" should have option "saved test report"
293 When I select "saved test report" from "Saved reports"
294 Then "objects[]" should have option "LinuxServers"
295 And "Last month" should be selected from "Reporting period"
296 And "Day of week" should be selected from "Statistics breakdown"
297 And "Soft states" should be selected from "State types to graph"
298 And "Ignore repeated states" should be checked
299 And "pink_n_fluffy" should be selected from "Skin"
300 And "Description" should contain "This is a saved test report"
301 When I click "Show report"
302 Then I should see "Last month"
303 And I should see "Alert histogram"
304 And I should see "This is a saved test report"
306 @configuration @asmonitor @reports
307 Scenario: Delete previously created report
308 Given I am on the Host details page
309 And I hover over the "Reporting" button
310 When I click "Histogram"
311 Then I should see "Saved reports"
312 And "Saved reports" should have option "saved test report"
313 When I select "saved test report"
314 Then "objects[]" should have option "LinuxServers"
315 When I click "Delete"
316 # Test available first, to force capybara to wait for page reload
317 Then "objects" should have option "LinuxServers"
318 And "Saved reports" shouldn't have option "saved test report"
319 And "objects[]" shouldn't have option "LinuxServers"