Forum Discussion

ravikumar24's avatar
ravikumar24
Icon for Nimbostratus rankNimbostratus
Feb 27, 2024

Hi - Need to export VIP name, IP, status (offline/available/unknown), pool and Poolmembers

Hi,

I went through many articles but couldn't find any script for a consolidated report that would have these details:

  • VIP name
  • VIP IP
  • VIP Status (offline/available/unknown)
  • pool
  • poolmembers

I did find separate articles though but not a consolidated one. I am new and not verse with scripting.

https://my.f5.com/manage/s/article/K72255145

https://my.f5.com/manage/s/article/K000135606

 

If anyone can please help with this required script it would be of great help.

 

Thanks in advance.

Regards,

Ravi

1 Reply

  • looks like below one did the job. 

    ==========================

     

    echo vs name, destination, state, pool, pool members
    VIRTUALS=$(tmsh list ltm virtual | grep "ltm virtual" | cut -d" " -f3)
    for VS in $VIRTUALS;
    do
      echo -n $VS,
      DEST=$(tmsh list ltm virtual $VS | grep destination | cut -d" " -f6)
      echo -n $DEST,
      AVAIL=$(tmsh show ltm virtual $VS | grep Availability | cut -d: -f2)
      echo -n \"$AVAIL\",
      POOL=$(tmsh list ltm virtual $VS | grep pool | cut -d" " -f6)
      echo -n $POOL,
      if [ -n "$POOL" ];
      then
        MBRS=$(tmsh list ltm pool "$POOL" | grep address | cut -d" " -f14)
        echo -n $MBRS
      fi
      echo
    done