Infoblox::IPAM::Statistics - Manages IPAM statistics.


NAME

Infoblox::IPAM::Statistics - Manages IPAM statistics.


DESCRIPTION

The IPAM statistics object is used to view the IPAM statistics of the network or network container in an Infoblox appliance.


CONSTRUCTOR

The Infoblox::IPAM::Statistics object does not require manual construction.


SESSION METHODS

This section describes all the methods in an Infoblox::Session that can be applied to a IPAM statistics object.

Infoblox::Session->get( )

Use this method to retrieve the existing objects from an Infoblox appliance. See Infoblox::Session->get() for parameters and return values.

Key Reference
 Apply the following attributes to get the IPAM statistics:
 network      - Required. An IPv4 address in dotted decimal notation followed by the network prefix (e.g 1.0.0.0/8).
 network_view - Optional. The name of the network view in which the network object is located. By default, all network views are searched.
Example
  my $ipam_stats = $session->get(
           object  => "Infoblox::IPAM::Statistics",
           network => "1.0.0.0/8",
           network_view => "my_network_view");

Infoblox::Session->search( )

Use this method to search for an IPAM statistics object from an Infoblox appliance. See Infoblox::Session->search() for parameters and return values.

Key Reference
 Apply the following attributes to get the IPAM statistics:
 network      - Required. An IPv4 address in dotted decimal notation followed by the network prefix (e.g 1.0.0.0/8) (regular expression).
 network_view - Optional. The name of the network view in which the network object is located. By default, all network views are searched.
Example
  my $ipam_stats = $session->search(
           object  => "Infoblox::IPAM::Statistics",
           network => '1\.0\.0\..*',
           network_view => "my_network_view");


METHODS

This section describes all the methods that can be used to retrieve the attribute values of a IPAM statistics object.

utilization( )

Use this method to retrieve the network utilization.

Parameter

none

Returns

The method returns the network utilization in percentage.

Example
 #Get utilization
 my $utilization = $ipam_stats->utilization();

conflict_count( )

Use this method to retrieve the number of conflicts discovered via network discovery. This method is only valid for a Network object.

Parameter

none

Returns

The method returns the number of discovered conflicts. For a NetworkContainer object, the return value is undefined.

Example
 #Get conflict_count
 my $conflict_count = $ipam_stats->conflict_count();

ms_ad_user_data( )

Use this method to retrieve Microsoft Active Directory users related information. This is a read-only attribute.

Parameter

None

Returns

The valid return value is an Infoblox::Grid::MSServer::AdUser::Data object.

Example
 #Get ms_ad_user_data
 my $ms_ad_user_data = $ipam_stats->ms_ad_user_data();

unmanaged_count( )

Use this method to retrieve the number of unmanaged IP addresses as discovered by network discovery. This method is only valid for a Network object.

Parameter

none

Returns

The method returns the number of unmanaged IP addresses. For a NetworkContainer object, the return value is undefined.

Example
 #Get unmanaged_count
 my $unmanaged_count = $ipam_stats->unmanaged_count();

utilization_update( )

Use this method to retrieve the time that the utilization statistics were updated last. This method is only valid for a Network object.

Parameter

none

Returns

The method returns a timestamp value in the ISO 8601 extended format for date and time (e.g. 2008-10-21T10:56:33Z or 2008-10-21T10:56:33.001Z). For a NetworkContainer object, the return value is undefined.

Example
 #Get utilization_update
 my $utilization_update = $ipam_stats->utilization_update();


SAMPLE CODE

The following sample code demonstrates the get and search session methods on an IPAM statistics object. Also, this sample code also includes error handling for the operations.

 #PROGRAM STARTS: Include all the modules that will be used
 use strict;
 use Infoblox;

#Preparation prior to getting IPAM statistics

 #Create a session to the Infoblox appliance
 my $session = Infoblox::Session->new(
     master   => "192.168.1.2",
     username => "admin",
     password => "infoblox"
 );
 unless ($session) {
    die("Construct session failed: ",
        Infoblox::status_code() . ":" . Infoblox::status_detail());
 }
 print "Session created successfully\n";
 my $member = Infoblox::DHCP::Member->new(
     name     => "infoblox.localdomain",
     ipv4addr => "192.168.1.2",
 );
 unless($member) {
      die("Construct member failed: ",
            Infoblox::status_code() . ":" . Infoblox::status_detail());
 }
 print "Member object created successfully\n";
 #Create a Network View object
 my $network_view = Infoblox::DHCP::View->new(
                     name => "my_network_view",
 );
 unless($network_view) {
             die("Construct Network View object failed: ",
                   Infoblox::status_code() . ":" . Infoblox::status_detail());
 }
 print "Network View object created successfully\n";
 #Add the Network View object into the Infoblox appliance through a session
 $session->add($network_view)
      or die("Add Network View object failed: ",
            $session->status_code() . ":" . $session->status_detail());
 print "Network View added successfully\n";
 #Create the Network object with this member
 my $network = Infoblox::DHCP::Network->new(
                     network => "1.0.0.0/255.0.0.0",
                     members => [ $member ],
                     network_view => $network_view,
 );
 unless($network) {
             die("Construct Network object failed: ",
                   Infoblox::status_code() . ":" . Infoblox::status_detail());
 }
 print "Network object created successfully\n";
 #Add the Network object into the Infoblox appliance through a session
 $session->add($network)
      or die("Add Network object failed: ",
            $session->status_code() . ":" . $session->status_detail());
 print "Network added successfully\n";
 #Create the DHCP Range object with this member
 my $dhcp_range = Infoblox::DHCP::Range->new(
     network    => "1.0.0.0/8",
     start_addr => "1.0.0.1",
     end_addr   => "1.0.0.10",
     member     => $member,
     network_view => $network_view,
 );
 unless($dhcp_range) {
      die("Construct DHCP Range failed: ",
            Infoblox::status_code() . ":" . Infoblox::status_detail());
 }
 print "DHCP range object created successfully\n";
 $session->add($dhcp_range)
      or die("Add DHCP range object failed: ",
            $session->status_code() . ":" . $session->status_detail());
 print "DHCP range added successfully\n";
 #Create the Fixed Address object
 my $fixed_address = Infoblox::DHCP::FixedAddr->new(
                                                "network" => "1.0.0.0/8",
                                                "ipv4addr" => "1.0.0.2",
                                                "mac" => "22:22:22:22:22:22",
                                                "network_view" => $network_view,
                                                );
 unless($fixed_address) {
      die("Construct DHCP Fixed address failed: ",
            Infoblox::status_code() . ":" . Infoblox::status_detail());
 }
 print "DHCP Fixed address object created successfully\n";
 $session->add($fixed_address)
      or die("Add DHCP Fixed address object failed: ",
            $session->status_code() . ":" . $session->status_detail());
 print "DHCP Fixed address added successfully\n";

#Get the IPAM statistics

  my @result_array = $session->get(
           object  => "Infoblox::IPAM::Statistics",
           network => "1.0.0.0/8",
           network_view => "my_network_view");
  my $ipam_stats = $result_array[0];
  unless ($ipam_stats) {
       die("Get IPAM statistics failed: ",
             $session->status_code() . ":" . $session->status_detail());
  }
  print "Get IPAM Statistics successful\n";
  print "Utilization for '1.0.0.0/8': ", $ipam_stats->utilization(), "\n";

#Search for the IPAM statistics

  my @result_array = $session->search(
           object  => "Infoblox::IPAM::Statistics",
           network => '1\.0\.0\..*',
           network_view => "my_network_view");
  my $ipam_stats = $result_array[0];
  unless ($ipam_stats) {
       die("Get IPAM statistics failed: ",
             $session->status_code() . ":" . $session->status_detail());
  }
  print "Get IPAM Statistics successful\n";
  print "Utilization for '1.0.0.0/8': ", $ipam_stats->utilization(), "\n";

#Clean up

  # Remove the IPAM Statistics object that was just retrieved
  $session->remove($ipam_stats);
  # Retrieve and remove the Network View object
  my $network_view = $session->get(
          object => "Infoblox::DHCP::View",
          name => "my_network_view",
  );
  unless ($network_view) {
       die("Get Network View failed: ",
             $session->status_code() . ":" . $session->status_detail());
  }
  $session->remove($network_view);
 ####PROGRAM ENDS####


AUTHOR

Infoblox Inc. http://www.infoblox.com/


SEE ALSO

Infoblox::Session, Infoblox::DHCP::Network,Infoblox::DHCP::View,Infoblox::DHCP::FixedAddr,Infoblox::DHCP::Range,Infoblox::Session->add(),Infoblox::Session->get(), Infoblox::Grid::MSServer::AdUser::Data


COPYRIGHT

Copyright (c) 2017 Infoblox Inc.