Infoblox::Grid::Member::Capture::Status - Traffic capture status object


NAME

Infoblox::Grid::Member::Capture::Status - Traffic capture status object


DESCRIPTION

You can retrieve the traffic capture status for a grid member via this object.


MODULE METHODS

The following functions are available to be applied to a traffic capture status object.

Infoblox::Grid::Member->traffic_capture( )

Use this function to retrieve the traffic capture status for the Grid Member. See Infoblox::Grid::Member->traffic_capture() for parameters and return values. Note that the member object must be retrieved from the appliance in order for the traffic capture method to be available.


METHODS

This section describes all the methods that explain a grid member's traffic capture status. All members are read-only.

file_exists( )

Use this method to retrieve a traffic capture file if it exists for the member. If the file exists, it can be downloaded using the export_data method in Infoblox::Session.

Returns

The method returns the attribute value, which can be "true" or "false".

Example
   #Get file_exists
   $exists = capstatus->file_exists();

file_size( )

Use this method to retrieve the size of the traffic capture file for the member.

Returns

The method returns the attribute value, which is the file size in bytes.

Example
   #Get the file_size
   $size = capstatus->file_size();

status( )

Use this method to retrieve the status of the capture operation for the grid member.

Returns

The method returns the attribute value, which can be "RUNNING", "STOPPED" or "UNKNOWN".

Example
   #Get the status
   $status = capstatus->status();


SAMPLE CODE

The following sample code demonstrates the different functions that can be applied to a capture status object. This sample also includes error handling for the operations.

#Preparation prior to traffic capture object operations

 #PROGRAM STARTS: Include all the modules that will be used
 use strict;
 use Infoblox;
 #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";

#Start traffic capture for a member

 # Get the grid member object.
 my $object = $session->get(
     object => "Infoblox::Grid::Member",
     name => "infoblox.localdomain",
 );
 unless ($object) {
       die("get grid member failed: ",
       $session->status_code() . ":" . $session->status_detail());
 }
 print "grid member get successful\n";
 my $capture = Infoblox::Grid::Member::Capture::Status->new(
                                                             action => 'START',
                                                             interface => 'ALL',
                                                             seconds_to_run => 2,
                                                            );
 unless ($object->traffic_capture($capture)) {
       die("traffic capture failed: ",
       $session->status_code() . ":" . $session->status_detail());
 }
 print "traffic capture started\n";
 my $capstatus = $object->traffic_capture();
 print "The capture is " . $capstatus->status() . "\n";
 ####PROGRAM ENDS####


AUTHOR

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


SEE ALSO

Infoblox::Session, Infoblox::Grid::Member


COPYRIGHT

Copyright (c) 2017 Infoblox Inc.