Infoblox::Grid::Member::Capture::Status - Traffic capture status object
You can retrieve the traffic capture status for a grid member via this object.
The following functions are available to be applied to a traffic capture status object.
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.
This section describes all the methods that explain a grid member's traffic capture status. All members are read-only.
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.
The method returns the attribute value, which can be "true" or "false".
#Get file_exists $exists = capstatus->file_exists();
Use this method to retrieve the size of the traffic capture file for the member.
The method returns the attribute value, which is the file size in bytes.
#Get the file_size $size = capstatus->file_size();
Use this method to retrieve the status of the capture operation for the grid member.
The method returns the attribute value, which can be "RUNNING", "STOPPED" or "UNKNOWN".
#Get the status $status = capstatus->status();
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####
Infoblox Inc. http://www.infoblox.com/
Infoblox::Session, Infoblox::Grid::Member
Copyright (c) 2017 Infoblox Inc.