Forum Discussion

Budd_Sieger's avatar
Budd_Sieger
Icon for Nimbostratus rankNimbostratus
Jan 15, 2015

icontrol

Through icontrol is there a method to run a script that we run manually (ssh) on the GTM? We are trying to automate DNS changes during maintenance via icontrol in an external script.

 

This is the script we are running on the GTM

 

!/usr/bin/perl -w

 

Set DNS for ITSMGB PROD to point to PROD1

system("/config/unisys/_add_cname itsmgb.ito.test.com. www.itsmgb-prod1.ito.test.com."); system("/config/unisys/_add_cname itsmgbcmdb.ito.test.com. itsmgbprod1cmdb.ito.test.com."); system("/config/unisys/_add_cname itsmgbt2.ito.test.com. itsmgbprod1t2.ito.test.com."); system("/config/unisys/_add_cname itsmgbt3.ito.test.com. itsmgbprod1t3.ito.test.com."); system("/config/unisys/_add_cname itsmgb-atg.ito.test.com. itsmgb-atg-prod1.ito.test.com.");[root@GNEAGFGINT01:Active] unisys

 

cat _add_cname

 

!/usr/bin/perl -w _add_cname This will update a CNAME record in ZoneRunner Jan 2014

use SOAP::Lite;

 

---- Check proper usage ----------------------------------------------------------------------------

if ($ARGV != 1) { print "Usage: add_cname \n"; exit 1; }

 

---- Update a CNAME record ---------------------------------------------------------------------------- -- Prepare a SOAP call with an iControl module and a server

$ResourceRecord = SOAP::Lite -> uri('urn:iControl:Management/ResourceRecord') -> proxy("");

 

- Prepare data structure(s) as argument to the call

$view_zones = { view_name => "external", zone_name => "ito.unisys.com." };

 

$cname_records = { domain_name => $ARGV[0], cname => $ARGV[1], ttl => 30 };

 

push @cname_records_A, $cname_records; push @cname_records_AofA, [@cname_records_A];

 

-- Call the method $soapResponse = $ResourceRecord->add_cname(

$ResourceRecord->add_cname( SOAP::Data->name(view_zones => [$view_zones]), SOAP::Data->name(cname_records => [@cname_records_AofA]) );

 

-- Keep this for later debugging ---------------------------------------------------------------------------- print $soapResponse->faultcode, " ", $soapResponse->faultstring, "\n"; exit();

1 Reply

  • So you want to use iControl to run a Perl script which makes iControl calls to implement a new CNAME or whatever?

     

    Why not just stick to iControl and skip most of the complexity.