Infoblox Exchange Cybersecurity Roadshow 2020 – Join us!
North America | Europe | Middle East/Africa | Asia-Pacific

Security

Reply

Perl API: Search for unmanaged IP addresses

SBanuelos
Techie
Posts: 1
1989     0

What is the best way (using the Perl API) to search for and display all records with type=UNMANAGED and/or status=Used, Unmanaged? I am looking for a way to search for these, but Session->search() doesn't appear to suppor the Infoblox::IPAM::Address object. I just need to be pointed in the right direction.

similar example

Authority
Posts: 37
1990     0

Hi,

 

Based on the API documentation one way is this :

#This will put all unmanaged records into an array
my @result = $session->get(
    object          => "Infoblox::IPAM::Address",
    status          => "used, unmanaged",
    #network         => $_->network(),  #to limit the search to a specific network
    );

But the method get doesn't support regex/wildcards.

For some reason I have this in one of my scripts to get all IPAM object with the "UNMANAGED" type :

#This will put all unmanaged records into an array
my @result = $session->get(
    object          => "Infoblox::IPAM::Address",
    status          => "used",
    #network         => $_->network(),  #to limit the search to a specific network
    );
foreach(@result)
{
    if($_->types() =~ m/UNMANAGED/)
    {
        print $_->ip_address() . "\tis unmanaged, last seen on " . $_->last_discovered() . "\n";
    }
}

 

Showing results for 
Search instead for 
Do you mean 

Recommended for You