The TCP monitor connects to a specific port on a host to verify that the service behind it is listening and responding.
🎯 功能说明
- Opens a TCP connection to a host:port
- Optionally sends data after connecting
- Optionally checks for expected data in the response
- Reads the service banner (if any)
- Measures connection time
⚙️ 配置
| 设置 | 描述 | 示例 |
|---|
| Name | A friendly name | Redis Production |
| Host / IP | Target hostname or IP | 10.0.0.5 |
| Port | TCP port number | 6379 |
| Send Data | Data to send after connecting | PING\r\n |
| Expect Data | Expected string in response | +PONG |
| Timeout | Connection timeout | 10 seconds |
📖 使用示例
Example 1: Check if a port is open
Just verify that port 8080 is accepting connections:
| 设置 | 值 |
|---|
| Name | App Server Port 8080 |
| Address | app.example.com |
| Port | 8080 |
Example 2: Redis health check
Send a PING command and expect PONG:
| 设置 | 值 |
|---|
| Name | Redis |
| Address | 10.0.0.5 |
| Port | 6379 |
| Send Data | PING\r\n |
| Expect Data | +PONG |
Example 3: Custom application protocol
| 设置 | 值 |
|---|
| Name | Game Server |
| Address | game.example.com |
| Port | 27015 |
💡 技巧
- TCP monitors are great for services that don't speak HTTP — databases, caches, message queues, custom applications.
- If you just need to check if a port is open, leave "Send Data" and "Expect Data" empty.
- For databases, consider using the dedicated MySQL/PostgreSQL/Redis monitors instead, which perform actual protocol checks.