Forum Discussion
bbensten_8485
Nimbostratus
Jan 03, 2009Simple HTTP Content Check
I need to know how to create a simple HTTP content validation from the CLI. I just want the HTTP monitor to do a simple http regex and based on the result remove/add to/from a pool.
1 Reply
- dennypayne
Employee
Just to clarify, a monitor won't actually remove members from a pool, it will mark them UP or DOWN depending on the result of the monitor (which continues to process regardless of state, so unless you've set Manual Resume, a pool member will return to UP status as soon as the monitor succeeds). Assuming that's what you want...
Your best bet would be to use a shell script or perl script that calls curl to send your GET string and then processes whatever regex you are wanting to parse. The script just needs to echo "up" to stdout upon success.
You can then use the bigpipe monitor command on the CLI (see man bigpipe) or the GUI to create an External type monitor and link it to your script. Then add that monitor to the pool. If the script doesn't return "UP" by the timeout you set, then the pool member(s)will be considered DOWN.
You can take a look at a sample script here (Click here). You may not need that level of flexibility but it does have some stuff "pre-built" that you might be able to use.
1 quirk: LTM provides the node IP as $1 and the port as $2 so you can inherit that info from the pool information (positional variables). BUT the node IP is in IPV6 format, that's the reason for the
line. Just FYI in case you roll your own.global_node_ip=$(echo "$1" | sed 's/::ffff://')
Hope that helps,
Denny
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