BIG-IP Configuration Visualizer
Problem this snippet solves:
This is a script utilizing the Graphviz package that will create graphs of the relationships of configuration objects of a virtual server.
How to use this snippet:
Requirements
- Perl
- SOAP::Lite
- Net::Netmask
- Graphviz
Note: There are other required packages, but the remainder are default in Ubuntu 10.10 perl distribution. This may not be the case with your configuration.
- Install dependent libraries via apt-get - depending on your distribution you may have all of these as packages:
- libssl-dev
- libcrypt-ssleay-perl
- libio-socket-ssl-perl
- libgraph-writer-graphviz-perl
- libsoap-lite-perl
- libnet-netmask-perl
- For any which aren't available, open a CPAN shell (perl -MCPAN -e shell) and install them with commands such as:
- install SOAP::Lite
- install Net::Netmask
- Grab the archive below, extract the perl script file, and make it executable
Minimal command-line invocation is:
./f5-gl.pl -t bigip-host-name.your.domain -u userid -p password
The output by default goes into a subdirectory img, but you might want to add the option -d output-directory to keep output files separate from successive runs, particularly if you will run the utility against different BIG-IP systems for different operational environments. You can also use these:
to run for only a particular VS (the partition must also be given)-c partition -v vs
to change the output file type - default is JPG, but there are the options of SVG or PNG-e
Run it!
Put it in
/etc/crontab
to run every night, perhaps, and output the files to a directory served by Apache? The files are predictably named, so you could link directly to them from other tools.
If you are averse to command-line parameters (perhaps you don't want the password to appear in a process listing) you can instead update these variables in the script:
my $ltm_host
my $user_id
my $user_password
- helpdesk_35922NimbostratusHello, is this working in BIG-IP V11? I've tried to execute the code and get: Uncaught exception from user code: 500 Can't connect to 172.31.20.54:443 (certificate verify failed) at ./f5-gv.pl line 723. SOAP::Lite::__ANON__('SOAP::Lite=HASH(0x1a42180)', '\x{a}not well-formed (invalid token) at line 1, column 3, byte 3 ...') called at /usr/share/perl5/SOAP/Lite.pm line 3796 SOAP::Lite::call('SOAP::Lite=HASH(0x1a42180)', 'get_version') called at /usr/share/perl5/SOAP/Lite.pm line 3761 SOAP::Lite::__ANON__('SOAP::Lite=HASH(0x1a42180)') called at ./f5-gv.pl line 723 main::get_api_version() called at ./f5-gv.pl line 283 Thanks Edoardo
- ANNimbostratus
@ Russell Moore is this work with version 12 ?
- Shaun_P__Hughe1Nimbostratus
@helpdesk
Editing line 62 "use SOAP::Lite;"
to read:
"use IO::Socket::SSL;
IO::Socket::SSL::set_defaults(SSL_verify_mode => 0);
use SOAP::Lite;
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME}=0;"
will allow you to connect with a self-signed certificate, not that it is the best of ideas.
Unfortunately, As of v11.4.0 the the get_httpclass_profile() function is deprecated immediately. Attempting to perform this function will return a not-implemented exception.
As a workaround you can change line 368 "my $vs_httpclass = get_vs_httpclass($vs_name) || 'NO_HTTPCLASS';"
to read:
"my $vs_httpclass = 'NO_HTTPCLASS';"
which let the script run until it errors out while trying to draw the images. By creating the subdirectories under ./img (example ./img/Common) the script ran successfully.
- Shaun_P__Hughe1Nimbostratus
You can remove your password from your bash history simply by running:
$ history $ history -d linenumber