cancel
Showing results for 
Search instead for 
Did you mean: 

How to execute show command for multiple vips in F5 ltm?

Danicoolbug
Nimbostratus
Nimbostratus

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''

 

1 ACCEPTED SOLUTION

Hi  

 

Can you please take a look at this codeshare,

 

https://devcentral.f5.com/s/articles/Export-Virtual-Server-Configuration-in-CSV-tmsh-cli-script?page...

 

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

 

View solution in original post

2 REPLIES 2

Hi  

 

Can you please take a look at this codeshare,

 

https://devcentral.f5.com/s/articles/Export-Virtual-Server-Configuration-in-CSV-tmsh-cli-script?page...

 

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

 

Danicoolbug
Nimbostratus
Nimbostratus

Thanks Jai. The script did the job👌