Reply
Highlighted
Accepted Solution

7.3.2 bug - Infoblox::DHCP::Network returns 0 elements

Expert
Posts: 16
5472     0

After the upgrade to 7.3.2 all Perl scripts that use the object: Infoblox:Smiley Very HappyHCP::Network returns 0 elements.

 

Re: 7.3.2 bug - Infoblox::DHCP::Network returns 0 elements

GHorne Community Manager
Community Manager
Posts: 254
5473     0

Did you upgrade your perl libraries as well ?

 

Re: 7.3.2 bug - Infoblox::DHCP::Network returns 0 elements

Expert
Posts: 16
5473     0

Yes thanks. The other scripts works good.

i.e. the object:

Infoblox:Smiley Very HappyHCP::NetworkContainer

returns the correct value.

 

Re: 7.3.2 bug - Infoblox::DHCP::Network returns 0 elements

Expert
Posts: 16
5473     0

 

That is a part of the Perl script maded for the check.

 

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 @nets_ref2 = $session->get( object => "Infoblox::DHCP::Network", network => '.*', );
Log("   Found ".scalar(@nets_ref2)." DHCP::Network , network => '.*'");
my @nets_ref3 = $session->get( object => "Infoblox::DHCP::Network", network => '10.5.0.0/24', );
Log("   Found ".scalar(@nets_ref3)." DHCP::Network , network => '10.5.0.0/24'");
my @nets_ref4 = $session->get( object => "Infoblox::DHCP::Network", contains_address => '10.5.0.1', );
Log("   Found ".scalar(@nets_ref4)." DHCP::Network , contains_address => '10.5.0.1'");
my @nets_ref5 = $session->get( object => "Infoblox::DHCP::Network", network_container => '10.0.0.0/8', );
Log("   Found ".scalar(@nets_ref5)." DHCP::Network , network_container => '10.0.0.0/8'");
Log("Retrieving list of existing Networks Containers from Grid");
my @nets_ref6 = $session->get( object => "Infoblox::DHCP::NetworkContainer" );
Log("   Found ".scalar(@nets_ref6)." DHCP::NetworkContainer");

 

and this is the output:

Retrieving list of existing Networks from Grid
    Found 0 DHCP::Network
    Found 0 DHCP::Network , network => '.*'
    Found 1 DHCP::Network , network => '10.5.0.0/24'
    Found 1 DHCP::Network , contains_address => '10.5.0.1'
    Found 121 DHCP::Network , network_container => '10.0.0.0/8'
Retrieving list of existing Networks Containers from Grid
    Found 379 DHCP::NetworkContainer

Re: 7.3.2 bug - Infoblox::DHCP::Network returns 0 elements

[ Edited ]
GHorne Community Manager
Community Manager
Posts: 254
5473     0

You can't use get() with a regex value. You have to use 'search().

 

get() pulls specific objects from the indexes (aka fast)

search() uses regex for non-indexed values (aka slow)

 

try :

 

$session->search( object => "Infoblox::DHCP::Network", network => '.*', ); 

 

Oh, and the container search shouldn't work at all

 

$session->get( object => "Infoblox::DHCP::NetworkContainer" );

The fact that is does is a bug. (and probably the result of us cleaning up all this oddness with the WAPI)

Re: 7.3.2 bug - Infoblox::DHCP::Network returns 0 elements

[ Edited ]
Expert
Posts: 16
5473     0

Thanks, in the past I have tried the search method for workaround, but i got the same bad result.
I try now change the test script with search instead the get and I publish it here the results.

 

 

Re: 7.3.2 bug - Infoblox::DHCP::Network returns 0 elements

Expert
Posts: 16
5473     0

Method get and search same results:

 

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 @nets_ref2 = $session->get( object => "Infoblox::DHCP::Network", network => '.*', );
Log("   Found ".scalar(@nets_ref2)." DHCP::Network , network => '.*'");
my @nets_ref2s = $session->search( object => "Infoblox::DHCP::Network", network => '.*', );
Log("   Found ".scalar(@nets_ref2s)." search DHCP::Network , network => '.*'");
my @nets_ref3 = $session->get( object => "Infoblox::DHCP::Network", network => '10.5.0.0/24', );
Log("   Found ".scalar(@nets_ref3)." DHCP::Network , network => '10.5.0.0/24'");
my @nets_ref4 = $session->get( object => "Infoblox::DHCP::Network", contains_address => '10.5.0.1', );
Log("   Found ".scalar(@nets_ref4)." DHCP::Network , contains_address => '10.5.0.1'");
my @nets_ref5 = $session->get( object => "Infoblox::DHCP::Network", network_container => '10.0.0.0/8', );
Log("   Found ".scalar(@nets_ref5)." DHCP::Network , network_container => '10.0.0.0/8'");
my @nets_ref6 = $session->get( object => "Infoblox::DHCP::Network", network_container => '0.0.0.0/0', );
Log("   Found ".scalar(@nets_ref6)." DHCP::Network , network_container => '0.0.0.0/0'");
Log("Retrieving list of existing Networks Containers from Grid");
my @nets_ref7 = $session->get( object => "Infoblox::DHCP::NetworkContainer" );
Log("   Found ".scalar(@nets_ref7)." DHCP::NetworkContainer");

the output:

Retrieving list of existing Networks from Grid
    Found 0 DHCP::Network
    Found 0 DHCP::Network , network => '.*'
    Found 0 search DHCP::Network , network => '.*'
    Found 1 DHCP::Network , network => '10.5.0.0/24'
    Found 1 DHCP::Network , contains_address => '10.5.0.1'
    Found 121 DHCP::Network , network_container => '10.0.0.0/8'
    Found 0 DHCP::Network , network_container => '0.0.0.0/0'
Retrieving list of existing Networks Containers from Grid
    Found 384 DHCP::NetworkContainer

Re: 7.3.2 bug - Infoblox::DHCP::Network returns 0 elements

Expert
Posts: 16
5473     0

I tried also this workaround:

 

Added the big major networks (containers) in IPAM

 

IPAM_WorkAround_Screenshot at Mar 17 17-56-24.png

The 0.0.0.0/0 is not possible, error.

 

And i make this Perl check script:

Log("Workaround");
my @nets_ref = $session->get( object => "Infoblox::DHCP::Network", network_container => '1.0.0.0/8', );
push (@nets_ref, $session->get( object => "Infoblox::DHCP::Network", network_container => '2.0.0.0/8', ));
push (@nets_ref, $session->get( object => "Infoblox::DHCP::Network", network_container => '3.0.0.0/8', ));
push (@nets_ref, $session->get( object => "Infoblox::DHCP::Network", network_container => '4.0.0.0/8', ));
push (@nets_ref, $session->get( object => "Infoblox::DHCP::Network", network_container => '5.0.0.0/8', ));
push (@nets_ref, $session->get( object => "Infoblox::DHCP::Network", network_container => '6.0.0.0/8', ));
push (@nets_ref, $session->get( object => "Infoblox::DHCP::Network", network_container => '8.0.0.0/5', ));
push (@nets_ref, $session->get( object => "Infoblox::DHCP::Network", network_container => '16.0.0.0/4', ));
push (@nets_ref, $session->get( object => "Infoblox::DHCP::Network", network_container => '32.0.0.0/3', ));
push (@nets_ref, $session->get( object => "Infoblox::DHCP::Network", network_container => '64.0.0.0/2', ));
push (@nets_ref, $session->get( object => "Infoblox::DHCP::Network", network_container => '128.0.0.0/1', ));
Log("   Found ".scalar(@nets_ref)." ALL Networks Workaround'");

But not work good, only first tree level, this is the output:

 

Workaround
    Found 269 ALL Networks Workaround'

 

 

Re: 7.3.2 bug - Infoblox::DHCP::Network returns 0 elements

Expert
Posts: 16
5473     0

I found a workaround, is not good but is a temporary solution.

is the search and not get:

 

>search( object => "Infoblox::DHCP::Network", network => '.*', );

 

and run the script with a user with elevated priviliges (admin group) past the user was R.O. and nogui

 

This is the output:

 

Retrieving list of existing Networks from Grid
    Found 0 DHCP::Network
    Found 0 DHCP::Network , network => '.*'
    Found 7277 search DHCP::Network , network => '.*'
    Found 1 DHCP::Network , network => '10.5.0.0/24'
    Found 1 DHCP::Network , contains_address => '10.5.0.1'
    Found 121 DHCP::Network , network_container => '10.0.0.0/8'
    Found 0 DHCP::Network , network_container => '0.0.0.0/0'
Retrieving list of existing Networks Containers from Grid
    Found 380 DHCP::NetworkContainer

 

7277 is the correct number of networks.

I tried this code in the production environment: it is slow and is not security compliant.
I wait a good solution.

 

 

Re: 7.3.2 bug - Infoblox::DHCP::Network returns 0 elements

Expert
Posts: 16
5473     0

up

Re: 7.3.2 bug - Infoblox::DHCP::Network returns 0 elements

GHorne Community Manager
Community Manager
Posts: 254
5473     0

Getting ALL the network will always be slow. There is no workaround for that, other then to ask yourself why you need all the networks (and if there is a way to re-design your query to get the desired result).

 

Other options also include using the WAPI or CSV export

 

You shouldn't have to be a superuser, but the user will need to have API access (not GUI access) and will need R/O access to ALL the networks.

Re: 7.3.2 bug - Infoblox::DHCP::Network returns 0 elements

Expert
Posts: 16
5473     0
Showing results for 
Search instead for 
Do you mean 

Recommended for You