Forum Discussion
F5 TCP Health Monitor Send/Receive strings
Hello Adrian,
If its L7 vip, go with http or https monitoring instead of TCP. That will be more recommended that usual port monitoring. if its a L4 vip, use below steps. i have added http monitoring details Aswell(receive and send).
https://my.f5.com/manage/s/article/K01524704
Steps to Create TCP Health Checks:
Log in to the LTM Device:
Access the LTM device through the command line or GUI.
Create a New TCP Health Monitor:
If using the GUI, navigate to Local Traffic > Monitors > Create.
If using the command line, you can use the tmsh command.
Configure the Monitor Settings:
Name: Assign a name to the monitor (e.g., TCP_Health_Check).
Type: Select TCP.
Send and Receive Strings:
The send and receive strings will depend on the specific application protocol running on the VIP. Here are some common examples:
Example for HTTP VIP:
Send String:
GET / HTTP/1.1\r\nHost: example.com\r\nConnection: close\r\n\r\n
This sends an HTTP GET request to the server.
Receive String:
HTTP/1.1 200 OK
This expects the server to respond with a 200 OK status.
Example for a Simple TCP Echo Server:
Send String:
HELLO
This sends a simple string HELLO to the server.
Receive String:
HELLO
This expects the server to echo back the same string HELLO.
Example Configuration in tmsh:
Here’s how you might configure a TCP health monitor with tmsh:
sh
tmsh create ltm monitor tcp TCP_Health_Check send "GET / HTTP/1.1\r\nHost: example.com\r\nConnection: close\r\n\r\n" recv "HTTP/1.1 200 OK"
Applying the Monitor to a Pool:
After creating the monitor, you need to assign it to the relevant pool:
sh
tmsh modify ltm pool my_pool monitors add { TCP_Health_Check }
Verifying the Configuration:
To ensure your monitor is working correctly, you can check the status:
sh
tmsh show ltm pool my_pool
This will show the status of the pool members and whether they are marked up or down based on the health checks.
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
