| Net-Appliance-Logical documentation | view source | Contained in the Net-Appliance-Logical distribution. |
Net::Appliance::Logical - Base Class for interacting various network appliances
use base 'Net::Appliance::Logical';
When managing a variety of network appliances, several common needs arise that this module attempts to automate.
sub new { my ( $class, $host, $opts ) = @_;
my $self = bless {}, $class;
croak "Must provide host"
unless $host;
$opts->{host} = $host;
$self->{config} = $opts;
return $self;
}
my $val = $obj->action( $name );
Given an action, uses the appropriate action method.
my $val = $obj->snmpget( $oid );
This method takes an OID number and returns the value it got from an SNMP query for that oid. Any timeticks are not translated, they are returned as an integer instead. Time::Duration is handy for translating it yourself.
Returns a connected Net::Appliance::Session object.
$obj->cmd('ping 1.2.3.4');
Executes a command via the connected session. You can pass an array to execute more than one command at a time.
$obj->privcmd('reboot');
Executes a priviledged command via the connected session. You can pass an array to execute more than one command at a time.
my $trimmed = $obj->trim( $string );
Trims whitespace from the beginning and end of a string
Christopher Heschong, <chris@wiw.org>.
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
| Net-Appliance-Logical documentation | view source | Contained in the Net-Appliance-Logical distribution. |