Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 
Custom Alert Banner

Need to remove health monitor on 1000's of pools and add a new health monitor

Ethereum7
Nimbostratus
Nimbostratus

Hi,

 

Any idea how I can bulk remove TCP health monitor and add in a new custom health monitor?

 

 

1 ACCEPTED SOLUTION

Everything jaikumar_f5 said about CPU utilization - absolutely true.

However, I see three ways of doing this.

One-liner, replaces the monitor on any pool.

tmsh list ltm pool one-line | awk '{ print $3 }' | xargs -I pl_name tmsh modify ltm pool pl_name monitor <NEWMONITOR>

Two-liner, first it filters for any pool that has "HTTP" in its name and then writes the pool name to a txt file.

tmsh list ltm pool one-line | grep -E 'HTTP' | awk '{ print $3 }' >> /shared/tmp/<FILENAME>.scf
for pl in `cat /shared/tmp/<FILENAME>.scf`; do tmsh modify ltm pool $pl monitor <NEWMONITOR> ; echo "$pl done" ; done

And last example, a two liner with manual intervention. It will write all pools to a txt file. You have to modify the text file manually and cut&replace the monitors manually, with vi or nano or else.

Afterwards you load the config from tmsh.

tmsh list ltm pool one-line >> /shared/tmp/<FILENAME>.scf
# nano or vi /shared/tmp/<FILENAME>.scf
load sys config file /shared/tmp/<FILENAME>.scf merge

View solution in original post

4 REPLIES 4

I don't see anything tedious in this task.

Pool monitor change is a one line command, be it one pool or 1000's of pool, it's still 1 command.

The worry some part is the CPU spike, when do you make this big change. All your existing monitors of those 1000 pools is just TCP, when you say you plan to put custom monitor, I take it's something http or https, so when this is done, the bigd daemon is going to rocket high and all your pools in your bigip will start flapping up & down.

Example: if a pool has 1server, it's 1000 pool members going for http/https health check all at once. Bigd will shoot up.

So whenever you do this big change, have the daemons monitored constantly.​

Let us know if you have any more questions.​

Everything jaikumar_f5 said about CPU utilization - absolutely true.

However, I see three ways of doing this.

One-liner, replaces the monitor on any pool.

tmsh list ltm pool one-line | awk '{ print $3 }' | xargs -I pl_name tmsh modify ltm pool pl_name monitor <NEWMONITOR>

Two-liner, first it filters for any pool that has "HTTP" in its name and then writes the pool name to a txt file.

tmsh list ltm pool one-line | grep -E 'HTTP' | awk '{ print $3 }' >> /shared/tmp/<FILENAME>.scf
for pl in `cat /shared/tmp/<FILENAME>.scf`; do tmsh modify ltm pool $pl monitor <NEWMONITOR> ; echo "$pl done" ; done

And last example, a two liner with manual intervention. It will write all pools to a txt file. You have to modify the text file manually and cut&replace the monitors manually, with vi or nano or else.

Afterwards you load the config from tmsh.

tmsh list ltm pool one-line >> /shared/tmp/<FILENAME>.scf
# nano or vi /shared/tmp/<FILENAME>.scf
load sys config file /shared/tmp/<FILENAME>.scf merge

Ethereum7
Nimbostratus
Nimbostratus

Thank you jaikumar_f5 and Daniel Wolf. This is switch from the standard tcp profile to a custom tcp profile. I originally thought I could just modify the standard TCP Profile but on the version I'm on you can't.  thank you the second one with two-lines worked great. I will do more testing on my dev LTM and monitor CPU before using on prod.

For profiles the tmsh command would be different, here an example for Client-side SSL profile

tmsh modify ltm virtual vs_myserver_443 profiles add { clientssl_myserver_new } profiles delete { clientssl_myserver_old }