on
07-Mar-2015
14:22
- edited on
05-Jun-2023
22:33
by
JimmyPackets
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:
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.
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:
-c partition -v vs
to run for only a particular VS (the partition must also be given)-e
to change the output file type - default is JPG, but there are the options of SVG or PNGPut 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
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.
You can remove your password from your bash history simply by running:
$ history $ history -d linenumber