For more information regarding the security incident at F5, the actions we are taking to address it, and our ongoing efforts to protect our customers, click here.

Forum Discussion

vimal1771_20809's avatar
vimal1771_20809
Icon for Nimbostratus rankNimbostratus
Sep 03, 2015

F5: curl command to add health-check to a pool

What is the curl command to add (append) health-check to a pool? The command should not replace already configured health-check on that pool. For example, I have a pool A configured with health monitor http and I want to add one more health monitor tcp.

 

5 Replies

  • GaganD's avatar
    GaganD
    Icon for Nimbostratus rankNimbostratus

    Hi Vimal,

    Why don't you just select two monitors(http and tcp,) in pool configuration. And then select atleast 2 health monitors as Availability requirement. This will achieve the same result, as F5 will do both tcp and http health checks on members, and even if one fails, node will be marked down. CURL is more of a troubleshooting utility for F5. An example config of the F5 pool as follows:-

    ltm pool webtest_csovmgmt115-80 {
        members {
            csovmgmt115:http {
                address 172.28.25.78
                session monitor-enabled
                state up
            }
        }
        monitor min 2 of { tcp http }
    }
    
  • im also confused about the mentioning of curl in this, or are you talking about an icontrol setup or such?

     

    in that case it is probably more a tmsh syntax thing, you often have an add function next to a replace-all or such.

     

  • We have automated PERL scripts which use REST APIs to configure F5 LTM.

     

    This just for example. I could add 2 health-checks "http" and "tcp" to a pool named APPTEST_POOL using below command. curl --silent --insecure -H "Content-Type: application/json" -u user:password -X PUT https:///mgmt/tm/ltm/pool/APPTEST_POOL -d '{"monitor":"http and tcp"}'

     

    If I have to add one more health-check say https then 1. I have to first read (GET) to get http and tcp 2. append https to it using "and" 3. and then set it using -d '{"monitor":"http and tcp and https"}' Instead do we have any alternative to skip reading of existing health-checks.

     

    Hope I am not confusing you all :).

     

  • GaganD's avatar
    GaganD
    Icon for Nimbostratus rankNimbostratus

    Sorry buddy even though I understand your pain and know where you are coming from, I don think its possible. Atleast not at the moment(maybe they will support in future).When you use PUT and specify a value for name, it will replace the existing configuration of that property. So if you do a post and specify https in your monitor value. It will replace all existing monitors, and just add the new one. There is some flexibility if the property is a collection or sub-collection(like members of pool), then you can have the URL of your PUT refer to a particular member of that collection. You can easily identify a collection in REST GET output, as a collection will be enclosed in square brackets. And to be honest I don't think you can achieve the same result with tmsh as well. So anything that cannot be done with tmsh, should be highly unlikely with REST as well, as far as my understanding is.