- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
WAPI GET for hostnames in IPAM records
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-18-2017 07:21 AM
I was able to dump all subnets using the following perl GET;
my $rest = REST::Client->new( { host => "https://$master/wapi/$REST_REV",} ); # GET the data from Infoblox $rest->GET( '/network?_max_results=' . $max_results_number . '&_return_fields%2B=extattrs' , $headers ); # convert the data to JSON my $res_data = decode_json( $rest->responseContent() );
I then enumerated all the IP addresses in those subnets;
# set up for enumerate my $phys_list_var = Net::Netmask->new2( $line->{network} ) or die $Net::Netmask::error; # get IPs in subnet @phys_ip_list = $phys_list_var->enumerate();
I then dumpted the host records;
$rest->GET( '/record:host?_max_results=' . $max_results_number, $headers ); my $host_data = decode_json( $rest->responseContent() );
Next I ran through the IP addresses I enumerated to match the hostnames from "record:host";
for my $hostline ( keys %hosts ) { my $net_count = 0; my $match = 0; for my $netline (@networks) { 1; if ($hostline eq $netline->{ip}) { 1; $networks[$net_count]{hostname} = $hosts{$hostline}; $match = 1; last; } $net_count++; 1; } #unless ($match) { # print "no match; $hostline $hosts{$hostline}\n"; # 1; #}
But I am winding up wth several unmatched host records and IP addresses from the network enumeration that do not have matching hostnames.
Is there a WAPI way to get the hostnames from the IPAM records?
Re: WAPI GET for hostnames in IPAM records
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
01-25-2017 09:20 AM
It turns out at least some of the missing host names are of the Type "IP Resvervation" rather than type "Host". Is there an API to pull IP Reservation records?
Re: WAPI GET for hostnames in IPAM records
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
02-07-2017 07:43 AM
"fixedaddress" is getting some, but not all of the additional host names. Any other objects I can try?