Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

help with this Perl Script ( missing Array)

Posted on 2014-11-07
14
Medium Priority
?
163 Views
Last Modified: 2015-01-02
Hello , I have this script that when I run it against this zone file I get this error


==> /local/bin/ms-fix-ad-rrs.pl -v Internal tdn.mcld.net.db

Can't use an undefined value as an ARRAY reference at /local/bin/ms-fix-ad-rrs.pl line 110, <> line 13722.

Can anyone have a look to see whats the issue? I cant seem to solve it.

BTW... The extensions were renamed.

The output should look like this if it worked for that zone name:

# ACL for DCs zone [indstream.com]
conf zone mod indstream.com set allow_update=[10.104.92.58, 10.104.92.57, 10.104.92.59, 10.104.92.56]
# AD Records for zone [indstream.com]
conf zone "" del host indstream.com view Internal
conf zone "" add a_rec indstream.com 10.104.92.58 view Internal
conf zone "" add a_rec indstream.com 10.104.92.57 view Internal

conf zone "" del host gc._msdcs.indstream.com view Internal
conf zone "" del host forestdnszones.indstream.com view Internal
conf zone "" del host domaindnszones.indstream.com view Internal
#--DC CNAMES

Thanks

Rich
ms-fix-ad-rrs-.txt
tdn.mcld.net.db.txt
0
Comment
Question by:richsark
  • 7
  • 7
14 Comments
 
LVL 85

Expert Comment

by:ozo
ID: 40428865
$rrs{'tdn.mcld.net'} was undefined.
Should it have been defined?
If so, what should it have been defined as?
Or what would you want to have happen when it is undefined?
0
 
LVL 1

Author Comment

by:richsark
ID: 40428972
Hi. I would like for it to run anyway or have it defined based on the name.

Does that make sense. ?
0
 
LVL 85

Expert Comment

by:ozo
ID: 40429024
Run in what manner? Have what defined based on what name?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 1

Author Comment

by:richsark
ID: 40429072
Hi.  Based on tdn.mcld.net.db
0
 
LVL 85

Expert Comment

by:ozo
ID: 40429094
Do you mean like this?
  my $dclist = join ( "," , @{ $rrs{$zone}||$rrs{'tdn.mcld.net.db'} } );
When I run your ms-fix-ad-rrs-.txt  on the data in your tdn.mcld.net.db.txt, $rrs{'tdn.mcld.net.db'}  is not defined either
0
 
LVL 1

Author Comment

by:richsark
ID: 40429421
Hi. So ...is there a way it can be forced to be defined. Like perhaps insert it ?
Or would it be easier to type it inside the file somewhere ?
0
 
LVL 85

Expert Comment

by:ozo
ID: 40429501
What do you want to define, and what do you want to define it to be?
0
 
LVL 1

Author Comment

by:richsark
ID: 40429648
Can it be defined as tdn.mcld.net.db
0
 
LVL 85

Expert Comment

by:ozo
ID: 40429744
If you mean you want to change,
  my $dclist = join ( "," , @{ $rrs{$zone} } );
to
  my $dclist = join ( "," , @{ $rrs{$zone}||$rrs{'tdn.mcld.net.db'} } );
that also finds nothing, since there is no line beginning with tdn.mcld.net.db in the http://filedb.experts-exchange.com/incoming/2014/11_w45/881747/tdn.mcld.net.db.txt file you posted.
0
 
LVL 1

Author Comment

by:richsark
ID: 40429768
Ok. So can I add it in the file. Just looking for ideas on how to achieve this
0
 
LVL 1

Author Comment

by:richsark
ID: 40429887
Hi Ozo,

so what I did is added this in that tdn.mcld.net.db file

tdn.mcld.net.   IN      A       100.100.100.1

I ran that script and it seemed to work once I added. So the question is, If that A record match is not there, the script fails.

So maybe if we can modify the script to output " Missing matching A Record for ..."

can this be done?
0
 
LVL 85

Expert Comment

by:ozo
ID: 40429922
You might insert the line
   die "Missing matching A Record for $zone" unless $rrs{$zone};
or perhaps change
  my $dclist = join ( "," , @{ $rrs{$zone} || ["Missing matching A Record for $zone"] } );
0
 
LVL 1

Author Comment

by:richsark
ID: 40429960
Ok. Great. Does it matter where I woukd inset these different options ?
0
 
LVL 85

Accepted Solution

by:
ozo earned 2000 total points
ID: 40430766
Before or in place of
my $dclist = join ( "," , @{ $rrs{$zone} } );
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

783 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question