F5 - How to List All Virtual Servers with Persistence Profiles

For F5 BigIP professionals/administrators, it is a tough but indispensable job, to generate reports of virtual servers and their associated resources like iRule, Persistence Profile, Client SSL profile etc.

I have already written various scripts to efficiently perform some of these reporting tasks and shared it here. you can find them here

This post joins the same list and this script could be used for the following scenarios

  1. To list all Persistence profiles and the Virtual servers associated with them
  2. To list all virtual servers having session persistence enabled along with the persistence profile name.
  3. To generate CSV report of virtual servers having  persistence profiles enabled
  4. To generate CSV report of persistence profiles and the virtual servers using them.

This is created on top of F5 BIGIP's inbuilt  tmsh command line interface.

Prerequisites:

  1.  You must have Advanced Shell Access in F5 Big IP
  2.  You should have python installed in the device ( This script tested with Python 2.6 )
  3.  Some basic command line skills ( unix )
  4.  putty to SSH

Version 

This script was tested with 11.6 and 13.1 F5 BigIP distributions

How to execute

Step1:  Login to the server using your favorite SSH terminal tool

Step2:  Copy the script( Choose according to your requirement, there are two scripts given below)  and save it to your desired location

Step3:  Execute the script as follows

python <scriptname.py> 

Note*: By default, the script is designed to print the output in a CSV format. You can redirect them to a .csv file and download and open it in excel. If you would like take a CSV report use the following command it will avoid the F5 Info & Error messages so that you will get just exactly what you are looking for

python <scriptname.py> 2>/dev/null >  somereport.csv

 

 

Sample Result:

 

The Source Code:

This script should be used when you have multiple partitions in your F5-BigIP

This script should be used when you have no partitions (or) just one default common Partition

 

Hope this Helps!

Cheers,

A K S A RA V

Write to us at [email protected]

 Follow us on Facebook or Twitter

 To Join our Community in Whatsapp – Click here