25-May-2021 22:32
i have a show command to get details of a single vip.
I have a list of 30 vip names in a single F5 device, i would like to know if there is any script that i can run the show command for 30 vips?
Example of the show command that am using:
show ltm virtual example-vs detail | grep -E 'Virtual Server: | Destination | Ltm::Pool Member: | IP Address | Availability | Ltm::Virtual Address: | grep -v 'Destination IP Bypasses''
Solved! Go to Solution.
25-May-2021
23:07
- last edited on
24-Mar-2022
01:21
by
li-migration
Hi
Can you please take a look at this codeshare,
Or you can go with simple bash script.
#!/bin/bash
echo "Virtual Server, State, Status" > /var/tmp/virtuals-output.csv
for vs in `cat /var/tmp/vs-input.txt`
do
virtual_state=`tmsh show ltm virtual $vs all-properties | grep "Availability" | awk '{print $3}'`
virtual_status=`tmsh show ltm virtual $vs all-properties | grep "State" | awk '{print $3}'`
echo "$vs,$virtual_state,$virtual_status" >> /var/tmp/virtuals-output.csv
done
25-May-2021
23:07
- last edited on
24-Mar-2022
01:21
by
li-migration
Hi
Can you please take a look at this codeshare,
Or you can go with simple bash script.
#!/bin/bash
echo "Virtual Server, State, Status" > /var/tmp/virtuals-output.csv
for vs in `cat /var/tmp/vs-input.txt`
do
virtual_state=`tmsh show ltm virtual $vs all-properties | grep "Availability" | awk '{print $3}'`
virtual_status=`tmsh show ltm virtual $vs all-properties | grep "State" | awk '{print $3}'`
echo "$vs,$virtual_state,$virtual_status" >> /var/tmp/virtuals-output.csv
done
05-Jun-2021 04:46
Thanks Jai. The script did the job👌