Forum Discussion
iRule to ping host
I'm pretty new to the Big IP load balancers. We have a couple servers on which we have SharePoint sites load balanced. The load balancing appears to work fine. Obviously, I've set up a Virtual Server with a virtual IP, so when users connect to a site, for instance sitename.domain.net, they will connect to the IP of the virtual server and get load balanced. However, we talked about being able to ping the sitename.domain.net from a specific workstation and getting the IP address of the member server to whichthe specific workstation is connected currently to aid in troubleshooting, instead of the IP of the Virtual Server configured on the load balancer. The SharePoint admins say they saw this when we initially set up the Virtual Server, and I've not made any changes on the load balancer since. We did make some DNS tweaks, but I don't see where this would have enabled them to tell which member a specific workstation is connected to. I'm thinking we could set up an iRule for this, but again I'm new to the F5. Any ideas? Maybe there is an easier way? Thanks.
33 Replies
- Darthw_20046
Nimbostratus
This is what I'm using, although the original code had the HTTP::uri as "/whichserver". I seemed to get the same result with the whichserver variable or the site uri. So, I should see the "Real ServerIP...." in the webpage? I'd rather have something in a header to the client.
when LB_SELECTED {
set whichserver [LB::server addr]
}
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] equals "website.domain.net" } {
HTTP::respond 200 content "Real server IP is: [LB::server addr]" noserver Content-Type "text/html" Connection "Close"
Stop processing the iRule for this event here
return
}
} - Mohamed_Lrhazi
Altocumulus
You want to use steve's iRule:when HTTP_RESPONSE { HTTP::header insert Via "[LB::server addr]" } and look for a response header called "Via", in any HTTP request you send to your virtual server. - Darthw_20046
Nimbostratus
Oh, thanks, for waking me back up Mohamed. I forgot about that earlier iRule for the header, and was getting mixed up. The HTTP_Response code works well with the ieHTTPHeaders in IE. Thanks guys. I provided the header response below for anyone else who might use this forum. See the "Via:" with IP address of the member shown at the end (I added the x-s" I think this would give the SharePoint admins what they need.
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: text/html; charset=utf-8
Server: Microsoft-IIS/7.5
SPRequestGuid: b8c992e8-db97-4635-9e3c-b7e485039f95
Set-Cookie: WSS_KeepSessionAuthenticated={c86b8502-59ed-40b7-9253-ac94de8edd6b}; path=/
X-SharePointHealthScore: 7
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
MicrosoftSharePointTeamServices: 14.0.0.6117
X-MS-InvokeApp: 1; RequireReadOnly
Date: Thu, 03 Jan 2013 17:34:43 GMT
Connection: keep-alive
Content-Length: 8275
Via: 10.x.x.x
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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