1 Feature: Alert history 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 | 1 | 0 | 1 | NULL | ERROR - tinky-winky |
34 | 2013-01-01 12:00:05 | 701 | NULL | NULL | win-server1 | Swap Usage | 1 | 0 | 1 | NULL | ERROR - out of teletubbies |
35 | 2013-01-01 12:00:02 | 801 | NULL | NULL | linux-server2 | | 0 | 1 | 1 | NULL | PRETTY OK - Jon Skolmen |
37 And I have activated the configuration
39 @configuration @asmonitor
40 Scenario: Single host alert history
41 Given I am on the Host details page
42 When I click "linux-server1"
43 And I click "Alert history"
44 Then I should see "OK - Sven Melander"
45 And I should see "Reporting period: Forever"
46 And I shouldn't see "win-server"
47 When I click "Edit settings"
48 Then "Show all" should be unchecked
49 And I should see "Selected hosts"
50 And "Selected hosts" should have option "linux-server1"
53 Then I shouldn't see "Sven Melander"
56 @configuration @asmonitor
57 Scenario: Service with host alert history
58 Given I am on the Service details page
59 When I click "Swap Usage"
60 And I click "Alert history"
61 Then I should see "ERROR - out of teletubbies"
62 And I should see "OK - laa-laa"
63 And I should see "win-server"
64 And I shouldn't see "linux"
65 And I shouldn't see "PING"
66 And I should see "Reporting period: Forever"
67 When I click "Edit settings"
68 Then "Show all" should be unchecked
69 And I should see "Selected services"
70 And "Selected services" should have option "win-server1;Swap Usage"
74 Then I should see "ERROR - out of teletubbies"
75 And I shouldn't see "OK - laa-laa"
77 @configuration @asmonitor
78 Scenario: Host with service alert history
79 Given I am on the Host details page
80 When I click "win-server1"
81 And I click "Alert history"
82 Then I should see "OK - laa-laa"
83 And I should see "ERROR - tinky-winky"
84 And I should see "ERROR - out of teletubbies"
85 When I click "Edit settings"
86 And I select "Host alerts"
88 Then I shouldn't see "ERROR - out of teletubbies"
89 And I shouldn't see "ERROR - tinky-winky"
90 And I should see "OK - laa-laa"
93 @configuration @asmonitor
94 Scenario: Switch object
95 Given I am on the Host details page
96 When I click "linux-server1"
97 And I click "Alert history"
98 Then I should see "OK - Sven Melander"
99 When I click "Edit settings"
100 Then "Available hosts" should have option "win-server1"
101 And "Selected hosts" should have option "linux-server1"
102 When I select "linux-server1" from "Selected hosts"
103 And I doubleclick "linux-server1" within "#fancybox-content"
104 Then "Available hosts" should have option "linux-server1"
105 When I select "win-server1" from "Available hosts"
106 And I doubleclick "win-server1"
107 Then "Selected hosts" should have option "win-server1"
108 When I click "Update"
109 Then I should see "ERROR - out of teletubbies"
110 And I should see "ERROR - tinky-winky"
111 And I should see "OK - laa-laa"
113 # Henrik claims I broke this once, so let's prove him wrong forever
114 @configuration @asmonitor
115 Scenario: Change option from all objects
116 Given I am on the Host details page
117 And I hover over the "Reporting" button
118 When I click "Alert History"
119 Then I should see "ERROR - out of teletubbies"
120 And I should see "OK - Sven Melander"
121 When I click "Edit settings"
124 Then I should see "ERROR - out of teletubbies"
125 And I shouldn't see "OK - Sven Melander"
128 @configuration @asmonitor
130 Given I am on the Host details page
131 When I click "win-server1"
132 And I click "Alert history"
133 Then I should see "OK - laa-laa"
134 And I should see "OK - po"
135 And I should see "ERROR - tinky-winky"
136 And I should see "ERROR - out of teletubbies"
137 When I click "Edit settings"
138 And I enter "1" into "Items to show"
139 And I check "Older entries first"
141 Then I should see "OK - laa-laa"
142 And I shouldn't see "OK - po"
143 And I shouldn't see "ERROR - tinky-winky"
144 And I shouldn't see "ERROR - out of teletubbies"
146 Then I shouldn't see "OK - laa-laa"
147 And I should see "OK - po"
148 And I shouldn't see "ERROR - tinky-winky"
149 And I shouldn't see "ERROR - out of teletubbies"
151 Then I shouldn't see "OK - laa-laa"
152 And I shouldn't see "OK - po"
153 And I should see "ERROR - tinky-winky"
154 And I shouldn't see "ERROR - out of teletubbies"
155 When I click "Previous"
156 Then I should see "OK - po"