http get
2 TopicsLTM HTTP Monitor Send and Receive syntax
Hi, I'm trying to configure a monitor that will check if a website is up on a Linux server. My Send string is GET /dms/loginForm.jpg HTTP/1.1\r\nHost:7270 \r\nConnection: close\r\n\r\n and if i leave the receive string blank it works and if I set the receive string to 200 OK it works, even though on of the sites is down. See below. [Joseph.Johnson@US-MABILLDC-INTLTM-02:Active:Changes Pending] ~ curl -vk http://10.202.10.169:7270/dms/loginForm.jsp About to connect() to 10.202.10.169 port 7270 (0) Trying 10.202.10.169... connected Connected to 10.202.10.169 (10.202.10.169) port 7270 (0) GET /dms/loginForm.jsp HTTP/1.1 User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 OpenSSL/1.0.1j zlib/1.2.3 libidn/0.6.5 Host: 10.202.10.169:7270 Accept: / < HTTP/1.1 200 OK < Cache-Control: no-cache < Date: Thu, 10 Aug 2017 20:00:03 GMT < Pragma: no-cache < Content-Length: 2824 < Content-Type: text/html; charset=UTF-8 < Expires: Thu, 01 Jan 1970 00:00:00 GMT < X-ORACLE-DMS-ECID: dc812bacc6eaa1df:-521687cc:15dcd4a6325:-8000-0000000000000163 < Set-Cookie: JSESSIONID=zarNu3_3TyGdblWUPx-DjF7ACO-t3xgVoiK9zVVT3zGdcvNJXN1U!-1852036927; path=/; HttpOnly [Joseph.Johnson@US-MABILLDC-INTLTM-02:Active:Changes Pending] ~ curl -vk http://10.202.10.70:7270/dms/loginForm.jsp * About to connect() to 10.202.10.70 port 7270 (0) * Trying 10.202.10.70... Connection refused * couldn't connect to host * Closing connection 0 curl: (7) couldn't connect to host Why is it that even with no connection made, the monitor is still marking the pool member as up when i set the receive string to 200 OK and is there anything i should change with it? Thanks in advance!535Views0likes4CommentsPersistence Across HTTP Methods
Problem this snippet solves: This code will provide persistence across GET & POST HTTP Methods using Client IP & SessionID as the persistence key. How to use this snippet: This code provides a simple structure that can be adapted to specific use cases. The code can be used as a standalone iRule or used along with Universal Persistence. It is recommended to enable OneConnect profile for this code in order to process individual HTTP Requests. Code : when HTTP_REQUEST { set HOST [string tolower [HTTP::host]] set SRCADDR [IP::remote_addr] if { $HOST contains "domain.com" } { #Match on HTTP Method GET if { [HTTP::method] equals "GET" } { set SESSIONID [findstr [HTTP::uri] "uuid=" 5 20] set KEY [crc32 $HOST$SESSIONID] #Persistence based on source address & session id present in URI persist hash $KEY 14400 #Start collecting content provided by POST method } elseif { (([HTTP::method] equals "POST") and ([HTTP::uri] contains "/amm/ampxml.jsp")) } { if {[HTTP::header "Content-Length"] ne "" && [HTTP::header "Content-Length"] <= 1048} { set CONTENT [HTTP::header "Content-Length"] } else { set CONTENT 1048 } if { $CONTENT > 0 } { HTTP::collect $CONTENT } } } } #Persistence based on the POST content when HTTP_REQUEST_DATA { if { (([HTTP::method] equals "POST") and ([HTTP::uri] contains "/amm/ampxml.jsp")) } { set HOST [string tolower [HTTP::host]] set SESSIONID [findstr [HTTP::payload] "uuid=" 5 20] set KEY [crc32 $HOST$SESSIONID] persist hash $KEY 14400 } } Tested this on version: 11.5253Views0likes0Comments