Hi,
I am in need of way to facilitate this senerio in a perl script.
I have CLI ( command line interface) which I run like so:
kip-tepltist -u Xxx -p Xxx
Which produces tones of names from each template it found:
194Iselin-NJ
33-IDFLB-North-611-Woodward-8600
34-IDFMBS-611-Woodward-860004-Vo
CAF-10.41.22
ukgla.ops.sun4us.bk
ukgla.ops.sun4us.prd
Basically the cli above is grabbing template information and spitting out the names of each and every template
Now that I have this list from above, I then need to run another CLI that gets the information of whats inside of each template from above. The CLI is use for this is:
./qip-getteinfo -U xx -P xx -n 194Iselin-NJ -t -o orig
The flags are:
U & P are user name and passwd
the -n is the name of the template I want to get its information
-t specifey what type of template
-o org id
So when I run this cli agianst 194Iselin-NJ the output looks like so:
template-name=194Iselin-NJ
template-type=DHCP Option Template
001=Same as in Subnet Profile
003=Same as in Subnet Profile
006=User Defined
006>User Defined=169.30.33.16 169.30.34.16
012=Same as in Object Profile
015=Same as in Subnet Profile
043=uktrq-uut-son4v-bk
051=Limited
051>Limited Lease Time=43200
066=169.30.34.62
186=169.30.34.62
187=[1f51]
What I need is a way to automate this.
I need a perl script that will run the first step, keep the names it finds some where on a text file perhaps,
Then run the next step, to reference the file names from step 1 and create a seperate file with the contents of all the names from step 1
So,
Run first part of the perl script
get the names of all the templates,
Second part of the perl script would reference the files from the first section and make a list .txt
so, the first one would be:
194Iselin-NJ
grab the contents and produce a file name 194Iselin-NJ.txt that would contain the template information of:
template-name=194Iselin-NJ
template-type=DHCP Option Template
001=Same as in Subnet Profile
003=Same as in Subnet Profile
006=User Defined
006>User Defined=169.30.33.16 169.30.34.16
012=Same as in Object Profile
015=Same as in Subnet Profile
043=uktsq-ops-sun4v-bk
051=Limited
051>Limited Lease Time=43200
066=169.30.34.62
186=169.30.34.62
187=[1f51]
Then loop and go to the next and so, on... until all the names and templates are created.
Thanks