File tree 2 files changed +11
-2
lines changed
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 60
60
options . http_error_critical = true
61
61
end
62
62
63
+ opts . on ( '--cookie [COOKIE]' , 'Login/Session cookie' ) do |v |
64
+ options . cookie = v
65
+ end
66
+
63
67
opts . on ( '-h' , '--help' , 'Display this screen' ) do
64
68
puts opts
65
69
exit 3
@@ -96,14 +100,15 @@ def open_options(options)
96
100
open_opts = {
97
101
:http_basic_authentication => [ options . user , options . password ]
98
102
}
103
+ open_opts [ 'Cookie' ] = options . cookie if options . cookie
99
104
100
105
# allows https with invalid certificate on ruby 1.9
101
106
# src: http://snippets.aktagon.com/snippets/370-hack-for-using-openuri-with-ssl
102
107
if options . insecure_ssl && RUBY_VERSION =~ /1\. 9/
103
108
open_opts [ :ssl_verify_mode ] = OpenSSL ::SSL ::VERIFY_NONE
104
109
end
105
110
106
- open_opts
111
+ return open_opts
107
112
end
108
113
109
114
def haproxy_response ( options )
@@ -119,7 +124,7 @@ def haproxy_response(options)
119
124
end
120
125
121
126
begin
122
- open ( options . url , open_options ( options ) )
127
+ return URI . open ( options . url , open_options ( options ) )
123
128
rescue OpenURI ::HTTPError => e
124
129
puts "ERROR: #{ e . message } "
125
130
options . http_error_critical ? exit ( CRITICAL ) : exit ( UNKNOWN )
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
+ set -e
4
+
3
5
echo -n " testing nothing smokes..."
4
6
for f in test/haproxy/* ; do
5
7
./check_haproxy.rb -u " $f " | head -n1
@@ -23,3 +25,5 @@ echo "OK"
23
25
echo -n " testing crit limit..."
24
26
./check_haproxy.rb -u " test/haproxy/fedoraproject_org.csv;" -w 1 -c2 -p fedmsg-raw-zmq-outbound-backend | grep ' CRIT.*too many sessions' > /dev/null
25
27
echo " OK"
28
+
29
+ echo " SUCCESS! ALL TESTS PASSED"
You can’t perform that action at this time.
0 commit comments