Forum Discussion

Nizar's avatar
Nizar
Icon for Altostratus rankAltostratus
Jun 16, 2025
Solved

CLI Command to Identify Virtual Servers Using L4 vs L7 Monitors

Hi Everyone,

I would like to ask if there is a CLI command to show on my BIG-IP device to grep the following:

1. Which virtual servers are still using pool with Layer 4 health monitors (e.g., tcp-half-open)?
2. Which virtual servers are already using pool with Layer 7 health monitors (e.g., http, https)?

Thank you very much 

  • Hi Nizar​ 

    Here is the script. I have tested and worked as expected :-)

    #!/bin/bash

    echo "=== Virtual Servers using L4 Monitored Pools (tcp, tcp-half-open) ===" for pool in $(tmsh list ltm pool one-line | grep -E 'monitor (tcp|tcp-half-open)' | awk '{print $3}'); do tmsh list ltm virtual one-line | grep "pool $pool" | awk -v p="$pool" '{print "Pool: " p " --> Virtual: " $3}' done

    echo

    echo "=== Virtual Servers using L7 Monitored Pools (http, https) ===" for pool in $(tmsh list ltm pool one-line | grep -E 'monitor (http|https)' | awk '{print $3}'); do tmsh list ltm virtual one-line | grep "pool $pool" | awk -v p="$pool" '{print "Pool: " p " --> Virtual: " $3}' done

2 Replies

  • f51's avatar
    f51
    Icon for Cumulonimbus rankCumulonimbus

    Hi Nizar​ 

    Here is the script. I have tested and worked as expected :-)

    #!/bin/bash

    echo "=== Virtual Servers using L4 Monitored Pools (tcp, tcp-half-open) ===" for pool in $(tmsh list ltm pool one-line | grep -E 'monitor (tcp|tcp-half-open)' | awk '{print $3}'); do tmsh list ltm virtual one-line | grep "pool $pool" | awk -v p="$pool" '{print "Pool: " p " --> Virtual: " $3}' done

    echo

    echo "=== Virtual Servers using L7 Monitored Pools (http, https) ===" for pool in $(tmsh list ltm pool one-line | grep -E 'monitor (http|https)' | awk '{print $3}'); do tmsh list ltm virtual one-line | grep "pool $pool" | awk -v p="$pool" '{print "Pool: " p " --> Virtual: " $3}' done

    • Nizar's avatar
      Nizar
      Icon for Altostratus rankAltostratus

      Hi f51​  ,

      Thank you very much for your help, I’ve tested the script and it works perfectly!

      If possible, could you also help me with a similar script for GTM?
      I’d like to check which Wide IPs are using Layer 4 and Layer 7 monitors on their associated pools.

      I would really appreciate your assistance on this as well.