Reply
Accepted Solution

get for the object Infoblox::DHCP::Network returns zero elements in ver.7.3.2

[ Edited ]
Expert
Posts: 16
6354     1

In the version 7.3.2 the Method:

Infoblox::Session->get( )

for the object:

Infoblox::DHCP::Network

(without any other attributes in the request)

returns always 0 (zero) elements.

This is the code:

my @nets_ref = $session->get( object => "Infoblox::DHCP::Network" );
Log("   Found ".scalar(@nets_ref)." Networks on Grid");

Re: get for the object Infoblox::DHCP::Network returns zero elements in ver.7.3.2

GHorne Community Manager
Community Manager
Posts: 254
6354     1

Unlike the WAPI, you need to specify some kind of search string. 

 

To get all the networks, for example, you would use 'network => '.*'

 

Re: get for the object Infoblox::DHCP::Network returns zero elements in ver.7.3.2

Expert
Posts: 16
6354     1

GHorne,

thanks for fast replay, i'm happy for this workaround but it not resolve I'm sorry.

my @nets_ref = $session->get( object => "Infoblox::DHCP::Network", network => '.*', );

always 0 elements.

The other nios versions work good and returns the numbers of objects (tried on: 7.2.2, 7.2.3, 6.12.15, 6.5.x, 6.8.x, 6.10.x, 6.11.x is all ok)

Re: get for the object Infoblox::DHCP::Network returns zero elements in ver.7.3.2

Expert
Posts: 16
6354     1

@DBordiga wrote:

GHorne,

thanks for fast replay, i'm happy for this workaround but it not resolve I'm sorry.

my @nets_ref = $session->get( object => "Infoblox::DHCP::Network", network => '.*', );

always 0 elements.

The other nios versions work good and returns the numbers of objects (tried on: 7.2.2, 7.2.3, 6.12.15, 6.5.x, 6.8.x, 6.10.x, 6.11.x is all ok)



Any one knows a trick or workaround to solve this problem?

Unfortunately it occurred with version 7.3.2 and blocks all scripts that have been created from this function.

Re: get for the object Infoblox::DHCP::Network returns zero elements in ver.7.3.2

tommymdempsey
Techie
Posts: 2
6354     1

Did you ever happen to get an answer for this? I'm having the same issue. A script that worked just fine before 7.3.4 does not work anymore. The problem area seems to be when getting all Network objects.

Re: get for the object Infoblox::DHCP::Network returns zero elements in ver.7.3.2

Authority
Posts: 26
6354     1

Have you tried search rather than get or perhaps the cursor?  I have a script I just tested that uses the cursor against a 7.3.4 DB and it returns the expected networks.

Re: get for the object Infoblox::DHCP::Network returns zero elements in ver.7.3.2

Expert
Posts: 16
6354     1

This is a big issue.
I think the problem is the number of networks. When is large, the server go to timeout and returns 0.
I try many workaround for extract a subset of data.

Re: get for the object Infoblox::DHCP::Network returns zero elements in ver.7.3.2

[ Edited ]
tommymdempsey
Techie
Posts: 2
6354     1

Thanks DRudder! Smiley Wink

 

The search appears to do the same thing for me. I switched my code to use a cursor instead and only grab 100 items at a time, and it seems to be working now. If I don't report back a failure, then it worked. As i'm writing this, it has already spit out 6481 rows. An added benefit of the cursor is that you actually see the output quickler since it does it in 100 item chunks.

 

All I changed in my code was the following:

 

 

#Before

 

my @retrieved_objs = $conn->get( 
  object => "Infoblox::DHCP::Network",
  network_view => "default"  );  
foreach my $obj (@retrieved_objs)

 

#after

 

my $cursor = $conn->new_cursor(
  fetch_size =>100,
  object => "Infoblox::DHCP::Network",
); #just replaced the for with a while and used the same $obj variable. #Didn't have to change anything in the code after this. Worked out nicely.
while(my $obj = $cursor->fetch())

 

Re: get for the object Infoblox::DHCP::Network returns zero elements in ver.7.3.2

Authority
Posts: 26
6354     1

If you believe it may be data set size related, then I'd suggest using the cursor as tommydempsey did. Let us know if you need help modifying your code as a workaround.

 

Additionally, I would suggest turning in a ticket with support for further investigation as this may be a bug.  They will probably ask for a DB backup and a copy of your script to reproduce the issue.

Highlighted

Re: get for the object Infoblox::DHCP::Network returns zero elements in ver.7.3.2

Expert
Posts: 16
6354     1

Great workaround i tryed cursor (same as tommymdempsey) and it work good.

 

Thanks to DRudder and tommymdempsey.

 

this is the check sample code:

 

 

# Load existing networks from Grid

Log("Retrieving list of existing Networks from Grid");
my @nets_ref1 = $session->get( object => "Infoblox::DHCP::Network" );
Log("   Found ".scalar(@nets_ref1)." DHCP::Network");

my $cnt = 0;
my $cursor = $session->new_cursor(
  fetch_size =>100,
  object => "Infoblox::DHCP::Network",
);
while(my $obj = $cursor->fetch()){
$cnt++;
};
Log("   Found ".$cnt." DHCP::Network --- cursor loop");

annd this is the output:

 


20160622-1445 -- Retrieving list of existing Networks from Grid
20160622-1448 -- Found 0 DHCP::Network
20160622-1453 -- Found 7559 DHCP::Network --- cursor loop

 

--Domenico

Showing results for 
Search instead for 
Do you mean 

Recommended for You