Forum Discussion
http status codes in http monitor
Hi,
I'm trying to make http monitor work with http status codes. However when I was reading debug logs for monitor the content where the recv string is searched does not contain HTTP headers and status code (according to logs, it does regexp searches only on data part of http answer). I even tried to specify 200 OK into recv field but it did not work.
Any idea how/if F5 in HTTP monitor supports analysis of http status code?
Data from log file:
2016-01-12 23:00:48.622608: ID 369 :(_recv_active_service_ping): rcvd 5120 bytes: --> Domov
...
2016-01-12 23:00:48.622648: ID 369 :(_recv_active_service_ping): Response matched regex [ addr=::ffff:10.65.17.16%2155:443 srcaddr=::ffff:10.65.17.251%0:54017 ] send=GET /\x0d\x0a\x0d\x0a
recv=Domov
disable=
---- reconfig for 200 OK recv string
-01-12 23:02:54.305084: ID 369 :(_recv_active_service_ping): Response did not match recv regex yet [ addr=::ffff:10.65.17.16%2155:443 srcaddr=::ffff:10.65.17.251%0:57008 ]
3 Replies
- IanB
Employee
The bigd (LTM) HTTP monitor should already look at both the header and content:
Note that this is not the behaviour of the DNS (aka GTM) http monitor, which works quite differently (see SOL13622 for details on that)
I've just done a test, and it seems to match the HTTP response code correctly:
ltm monitor http http_200_ok { adaptive disabled defaults-from http destination *:* interval 5 ip-dscp 0 recv "200 OK" send "GET / HTTP/1.0\r\n\r\n" time-until-up 0 timeout 16 }
... and it matched this response:
HTTP/1.1 200 OK Date: Wed, 13 Jan 2016 00:27:48 GMT Server: Apache/2.4.7 (Ubuntu) Last-Modified: Tue, 01 Sep 2015 02:47:01 GMT ETag: "a6d-51ea69081150d" Accept-Ranges: bytes Content-Length: 2669 Vary: Accept-Encoding Connection: close Content-Type: text/html
/var/log/bigdlog shows that it did match:
[0][20364] 2016-01-12 16:31:33.833476: ID 44 : Response Code: 200 (OK) [ addr=::ffff:5.0.0.11:80 srcaddr=::ffff:5.0.0.211%0:57568 ] [0][20364] 2016-01-12 16:31:33.833486: ID 44 :(_recv_active_service_ping): Response matched regex [ addr=::ffff:5.0.0.11:80 srcaddr=::ffff:5.0.0.211%0:57568 ] send=GET / HTTP/1.0\x0d\x0a\x0d\x0a recv=200 OK
- janklepek_24317
Nimbostratus
ah, i have found out why.
the missing "HTTP/1.0" in send string caused this situation
- IanB
Employee
That makes sense. If you omit the HTTP version in your request string (and the default send string is just 'GET /'), then the web server must assume HTTP 0.9, (which has no headers), so there would have been no headers and no status code in the webserver's reply to match against.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com