File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3030# alerts only if the check fails x times within the last y attempts
3131# where x is the threshold and y is the window.
3232#
33+ # reverse_content_match
34+ # When (optional) true, reverses the behavior of the content_match option,
35+ # i.e. the HTTP check will report as DOWN if the string or expression
36+ # in content_match IS found. (default is false)
37+ #
3338# content_match
3439# The (optional) content_match parameter will allow the check
3540# to look for a particular string within the response. The check
166171 $threshold = undef ,
167172 $window = undef ,
168173 $content_match = undef ,
174+ $reverse_content_match = false ,
169175 $include_content = false ,
170176 $http_response_status_code = undef ,
171177 $collect_response_time = true ,
196202 ' threshold' => $threshold ,
197203 ' window' => $window ,
198204 ' content_match' => $content_match ,
205+ ' reverse_content_match' => $reverse_content_match ,
199206 ' include_content' => $include_content ,
200207 ' http_response_status_code' => $http_response_status_code ,
201208 ' collect_response_time' => $collect_response_time ,
Original file line number Diff line number Diff line change 4242 it { should contain_file ( conf_file ) . without_content ( %{threshold: } ) }
4343 it { should contain_file ( conf_file ) . without_content ( %r{window: } ) }
4444 it { should contain_file ( conf_file ) . without_content ( %r{content_match: } ) }
45+ it { should contain_file ( conf_file ) . without_content ( %r{reverse_content_match: true} ) }
4546 it { should contain_file ( conf_file ) . without_content ( %r{include_content: true} ) }
4647 it { should contain_file ( conf_file ) . without_content ( %r{collect_response_time: true} ) }
4748 it { should contain_file ( conf_file ) . without_content ( %r{http_response_status_code: } ) }
6768 threshold : 456 ,
6869 window : 789 ,
6970 content_match : 'foomatch' ,
71+ reverse_content_match : true ,
7072 include_content : true ,
7173 collect_response_time : false ,
7274 disable_ssl_validation : true ,
9092 it { should contain_file ( conf_file ) . with_content ( %r{threshold: 456} ) }
9193 it { should contain_file ( conf_file ) . with_content ( %r{window: 789} ) }
9294 it { should contain_file ( conf_file ) . with_content ( %r{content_match: 'foomatch'} ) }
95+ it { should contain_file ( conf_file ) . with_content ( %r{reverse_content_match: true} ) }
9396 it { should contain_file ( conf_file ) . with_content ( %r{include_content: true} ) }
9497 it { should contain_file ( conf_file ) . without_content ( %r{collect_response_time: true} ) }
9598 it { should contain_file ( conf_file ) . with_content ( %r{disable_ssl_validation: true} ) }
Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ instances:
3232<% if instance['window'] -%>
3333 window: <%= instance['window'] %>
3434<% end -%>
35+ <% if instance['reverse_content_match'] -%>
36+ reverse_content_match: <%= instance["reverse_content_match"] %>
37+ <% end -%>
3538<% if instance['content_match'] -%>
3639 content_match: '<%= instance["content_match"] %> '
3740<% end -%>
You can’t perform that action at this time.
0 commit comments