Forum Discussion
iRule with monitor (monitoring if connection = first)
Good afternoon,
I have a task to monitor three application servers, currently, the servers return these responses: jvm1=0, jvm1=9 and other numbers which are considered as the server (from the pool of three) is down.
the situation is that we want to change the monitor to track also a status of the TCP session (because of redirects of users to another server of those three -> they have to log in again). If the session is first there should be this clause used:
if connection = first
if recv=('jvm1=0') -> server OK
else -> NOK
if the connection is not first - the connection has been already made before (two recv strings to determine if server is up):
if connection = NOT first
if recv=('jvm1=0' OR 'jvm1=9') -> OK
else -> NOK
Is there any way how to determine if the session is first? I guess there should be iRule created under the VS. Sorry for my terminology, I am pretty new in the f5 field. Thank you
2 Replies
- PeteWhite
Employee
A good way to determine if this is the first HTTP request on a TCP session or a later one is to insert a cookie into the stream. If you receive it back then it is not the first request.
Slightly confused what you mean about monitors and what you actually want to achieve though
- Hamish
Cirrocumulus
BigIP will do this out of the box with session persistence. Choose from IP, Cookie or if you're feeling adventurous you can design the persistence method yourself with an iRule.
Determining whether the connection is a new session or a new connection for the existing session is reasonably protocol dependent (Except where you do something like assume a 1:1 relationship between IP and client and persist at the source IP level of course)
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