Infoblox perl api错误1002-创建DNS区域时缺少或不正确的参数



我正在设置一个perl脚本,用于与运行NIOS 5.1的一些infblox设备进行通信,我被下面的代码部分卡住了。该部分用于创建Reverse Zone记录。

任何指针我可能做错了什么?

#!/usr/bin/perl
require Infoblox;
use Getopt::Std;
use Term::GetKey;
use JSON;
use Data::Dumper;
use VCIM qw ( load_config getline unpack_netmask pack_netmask validate_netmask validate_vlan        get_first_ip get_last_ip get_next_ip dprint
write_config i18n hash_merge dqtobin bintodq binmax binmin ip_is_used );
my $DEBUG=1;
my $overwrite=0;
my $match;
my %options;
getopts('yp:', %options);
if (defined $options{'y'}) {
$overwrite = 1;
}
# read settings from settings.conf
my %config;
%config = %{load_config()};
# acquire infoblox handle
dprint("nConnecting to $infobloxip as $infobloxuser" . ($infobloxpass eq 'default' ? " using     default password 'default'":"")."n");
my $ibh = Infoblox::Session->new(
master => $infobloxip,
password => $infobloxpass,
username => $infobloxuser
);
my @searchres = $ibh->search(
"object" => "Infoblox::Grid::Member",
"name" => ".*"
);
unless (@searchres) {
if ( defined $config{'credentials'}{'infobloxPass'} ) {
dprint("Connection failed. (Status Code " . $ibh->status_code() . ": " . $ibh->status_detail() . ").n");
dprint("Trying again. Will use config password instead.n");
$infobloxpass = $config{'credentials'}{'infobloxPass'};
$ibh = Infoblox::Session->new(
  master => $infobloxip,
  password => $infobloxpass,
  username => $infobloxuser);
@searchres = $ibh->search(
  "object" => "Infoblox::Grid::Member",
  "name" => ".*"
);
unless (@searchres) {
  die ($ibh->status_code() . ':' . $ibh->status_detail());
}
} else {
die ($ibh->status_code() . ':' . $ibh->status_detail());
}
}
sub create_zones {
my $oct0 = shift;
my $oct1 = shift;
my $oct2 = shift;
my $netbits = shift;
$netbits = ($netbits>24?24:$netbits);
#one network for /8, /16, /24, or  2^x where x is each bit less than the classful boundary
$networks = ($netbits%8==0?1:(2**(8-($netbits%8))));
my $snb = ($netbits<24 && $netbits>16 ? $oct2 : ($netbits > 8 ? $oct1 : $oct0));
for (my $i=0;$i<$networks;$i++) {
if ($i>0) {
${$snb}++;
}
dprint("Creating Reverse zone $oct2.$oct1.$oct0.in-addr.arpa... ");
my $newzone = Infoblox::DNS::Zone->new(
name  => $oct2.".".$oct1.".".$oct0."."."0"."/".($netbits%8==0?$netbits:$netbits + (8 - ($netbits%8))),
enable_rfc2317_exclusion => "true",
disable => "false",
primary => $dns_member
);
unless (my $response = $ibh->add($newzone)) {
  unless ($ibh->status_code() == 1005) {
    die ($ibh->status_code() . ":" . $ibh->status_detail());
  }

完整错误码为1002:One or more arguments in request are missing or incorrect at infobloxSetup.pl line 601, <RUC> line 657.

结果它不是perl相关的,问题是enable_rfc2317_exclusion => "true"在我使用的API版本中不受支持

相关内容

  • 没有找到相关文章

最新更新