cancel
Showing results for 
Search instead for 
Did you mean: 

Pearl script to change pool IP transparency

Highlighted
Occasional Contributor

Pearl script to change pool IP transparency

Hi all

Been searching in the documentation but failed to find any script to modify connection management part of a pool, especially the IP transparency. Anywhere I can find the documention or any similar article post on this? Appreciate the help received.
2 REPLIES
Occasional Contributor

Re: Pearl script to change pool IP transparency

Hello,

 

Please try the below script

 

#!/usr/bin/perl

use SOAP::Lite;

# This is the url of the Traffic Manager Admin Server
my $admin_server = 'https://admin:adminpass@mystm:9090';
my $conn = SOAP::Lite -> ns('http://soap.zeus.com/zxtm/1.0/Pool/') -> proxy("$admin_server/soap", ssl_opts => [ SSL_verify_mode => SSL_VERIFY_NONE ]); my $pool = $ARGV[0]; my $trans = $ARGV[1]; if ( $trans == 1 ) { $conn->setTransparent( [ $pool ], [ 1 ]); } else { $conn->setTransparent( [ $pool ], [ 0 ]); } $res = $conn->getTransparent( [$pool] ); my @enabled = @{$res->result}; if( $enabled[0] ) { print "$pool is Transparent\n"; } else { print "$pool is not Transparent\n"; }

Simply execute the script passing in the name of the pool and a 1 to enable transparency, or a 0 (anything else) to disable it. 

Eg:

 

mark@goldfish ~/Source/ZXTM_SOAP $ ./setTrans.pl www.demo.local 1
www.demo.local is Transparent
mark@goldfish ~/Source/ZXTM_SOAP $ ./setTrans.pl www.demo.local 0
www.demo.local is not Transparent

 

Cheers,

Mark

Occasional Contributor

Re: Pearl script to change pool IP transparency

Ahh, thanks, looks promising and similar to mine after some reading. But will it be ok to use that setTrans.pl as an action program in the Action Alert?