on 30-Mar-2017 10:01
Problem this snippet solves:
When creating monitor, we usually check web site availability with curl.
These commands allow to check if HTTP Monitor send string is correct
How to use this snippet:
from F5 cli (not tmsh) run following commands
Monitor HTTP:
SEND_STRING='Monitor String'
(echo -ne $SEND_STRING; cat) | nc 'Pool Member IP' 'Pool member port'
Monitor HTTPS:
SEND_STRING='Monitor String'
(echo -ne $SEND_STRING; cat) | openssl s_client -host 'Pool Member IP' -port 'Pool member port' -quiet
example:
SEND_STRING='GET / HTTP/1.1\r\nHost: www.company.com\r\nConnection: Close\r\n\r\n'
(echo -ne $SEND_STRING; cat) | nc 1.2.3.4 80
SEND_STRING='GET / HTTP/1.1\r\nHost: www.company.com\r\nConnection: Close\r\n\r\n'
(echo -ne $SEND_STRING; cat) | openssl s_client -host 1.2.3.4 -port 443 -quiet
Code :
No file
Tested this on version:
11.6Hello Stanislas,
I tried the below command but it just shows me SSL errors. Can you assist?
(echo -ne "GET / HTTP/1.1\\r\\nHost: abc.com\\r\\nConnection: Close\\r\\n"; cat) | openssl s_client -connect 1.1.1.1:443 -quiet
47753692343424:error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure:s3_pkt.c:1293:SSL alert number 40 47753692343424:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:s23_lib.c:184:
It shows me the above errors after being connected.
Note: I do not have a DNS entry for abc.com in place
Regards,
Ajit
Why did you add 2 \ in send string ? did you get it from tmsh which add a second \ in config file?
try this:
(echo -ne "GET / HTTP/1.1\r\nHost: abc.com\r\nConnection: Close\r\n"; cat) | openssl s_client -connect 1.1.1.1:443 -quiet
How can I use this command with NTLM authentication? The monitor works in the gui when credentials are specified but I get access denied from CLI.
Thanks,
LM