This python script uses ssh/tmsh to access a BIG-IP and iterates through virtual servers looking for unused virtuals so that the virtual and associated configuration objects can be removed/cleaned from a BIG-IP system.
Install onto a system that has python+paramiko
then execute and provide arguments.
usage: ssh_bigip_cleaner.py [-h] (--scan | --remove | --scanandremove) --bigip
BIGIP --user USER [--file FILE] [--vipNoDns]
[--vs0TotalConns] [--vs0CurConns] [--vsDisabled]
Like this, looks very good (sure will link to for an answer to two in the future), just wondering if it could be expand to uses iControl or iControl REST API instead of SSH and TMSH?
Python F5 iControl REST library
The version above was actually a second revision (rewrite) of an original that used iControl REST. For the customer in question, they had software that pre-dated REST, so I rewrote it to use SSH/TMSH via paramiko at their request.
Just uploaded a version (slightly different capabilities) that uses iControl REST at: