Forum Discussion

lucqui_350705's avatar
lucqui_350705
Icon for Nimbostratus rankNimbostratus
Feb 06, 2018

Create a monitor and attach it to a pool upon creation through iControl POST

I cannot see a way to create a custom monitor using iControl before creating a pool. I would like to do both using the same script. This is what I have to create my pool:

curl -sku admin:admin $f5_uri \
-X POST \
-H "Content-Type: application/json" \
-d "$(generate_payload)"

I would like generate_payload to include a new monitor for this pool (that checks for "OK"), I just haven't been able to find anyone who has done this using POSTs.

Thanks!

1 Reply

  • Hello,

    This payload create and HTTP monitor, $f5_uri=

    '{"name": "icontrolmon", "send": "GET /server \\r\\n", "recv": "OK"}'
    

    When you create a pool you can include your monitor name in the payload

    '{"name": "icontrol", "monitor": "/Common/icontolmon"}'