Forum Discussion
Chris_Day_10331
Nimbostratus
Oct 04, 2005iRule for Server Testing
Good morning,
Please see attached doc.
Essentially, what we are trying to achieve is to be able to validate that a single server behind a VS is responding correctly. Ideally, we co...
Chris_Day_10331
Nimbostratus
Oct 04, 2005Hi Guys,
Thanks for replying - this is truly a big help. I now have a better understanding of how this all works and have been analyzing the results captured with tcpdump. Here is what I am seeing:
If I issue the following (via telnet):
telnet blacks.test.pnimedia.com
GET / HTTP/1.1
HOST: blacks.pnimedia.comEverything works fine and I get the expected content.
*However*, via the rule I have created according to your posts everything seems to be correct. Is it possible that the HTTP/1.1 header is not being included in the request down to the node? I am seeing this (as expected) in the 'ltm' logs:
Rule PNI_TestProcessor : Replacing host from blacks.test.pnimedia.com to blacks.pnimedia.com
Rule PNI_TestProcessor : Searching for node: web002
Rule PNI_TestProcessor : Routing to node: 10.10.20.51 Which is correct!
Tcpdumps, however, reveal a different story. The external dump captured was as follows:
tcpdump -w /var/tmp/external.dump -ni external port 80 and host 64.85.47.204The internal dump captured was as follows:
tcpdump -w /var/tmp/internal.dump -ni internal port 80 and host 64.85.47.204Both of these are attached, but as a summary it looks like request is malformed.
For reference, here is what is in the rule "PNI_TestProcessor" which I have attached to the VS in question:
when HTTP_REQUEST {
Search for host mapping in the lookup list
set new_host [findclass [HTTP::host] $::host_mapping " "]
if { "" ne $new_host } {
if mapping is found, replace the Host header
log local0. "Replacing host from [HTTP::host] to $new_host"
HTTP::header replace "Host" $new_host"
Pull out the node name as the first element of the uri
ie. /web001/foo/bar -> web001
set node_name [lindex [split [HTTP::uri] "/"] 1]
if { "" ne $node_name } {
Now look for the node address in the lookup list
log local0. "Searching for node: $node_name"
set node_addr [findclass $node_name $::node_mapping " "]
if { "" ne $node_addr } {
log local0. "Routing to node: $node_addr "
node $node_addr
} else {
log local0. "Didn't find node '$node_name' in lookup class"
}
} else {
log local0. "No node name passed in URI"
}
} else {
log local0. "Didn't find [HTTP::host] in lookup class"
}
}Do you guys have any ideas on this?
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects