Cisco::SNMP::Config - Configuration Interface for Cisco Management
use Cisco::SNMP::Config;
The following methods are for configuration file management. These methods implement the CISCO-CONFIG-COPY-MIB for configuration file management. If these operations fail, the older method in OLD-CISCO-SYS-MIB is tried. All Catalyst OS operations are performed against the CISCO-STACK-MIB.
CISCO-CONFIG-COPY-MIB
OLD-CISCO-SYS-MIB
CISCO-STACK-MIB
my $cm = Cisco::SNMP::Config->new([OPTIONS]);
Create a new Cisco::SNMP::Config object with OPTIONS as optional parameters. See Cisco::SNMP for options.
my $cc = $cm->config_copy([OPTIONS]);
Manage configuration files. Options allow for TFTP upload or download of running-config or startup-config and a copy running-config to startup-config or vice versa. Valid options are:
Option Description Default ------ ----------- ------- -catos Catalyst OS boolean flag. Enable if 0 device runs Catalyst OS. -dest 'startup-config', 'running-config' 'startup-config' or filename for TFTP server -family Address family IPv4/IPv6 [Inherit from new()] Valid values for IPv4: 4, v4, ip4, ipv4, AF_INET (constant) Valid values for IPv6: 6, v6, ip6, ipv6, AF_INET6 (constant) -password Password for 'ftp', 'scp', 'sftp' 'cisco' -protocol 'ftp', 'rcp', 'scp', 'sftp', 'tftp' 'tftp' -source 'startup-config', 'running-config' 'running-config' or filename on TFTP server -server Copy server address localhost -timeout Seconds until timeout for completion 10 check -username Username for 'ftp', 'rcp', 'scp', 'cisco' 'sftp'
The default behavior with no options is copy running-config startup-config.
copy running-config startup-config
NOTE: Use care when performing TFTP upload to startup-config. This MUST be a FULL configuration file as the config file is NOT merged, but instead OVERWRITES the startup-config.
A hostname value for tftp will be resolved to IPv4/v6 based on family. Family is inherited from the value set in new() but can be overriden. Providing a numeric address will also self-determine the IPv4/v6 address.
Allows the following accessors to be called.
$cc->ccStartTime();
Return the start time of the configuration copy operation relative to system uptime.
$cc->ccEndTime();
Return the end time of the configuration copy operation relative to system uptime.
The following are inherited methods. See Cisco::SNMP for more information.
None by default.
This distribution comes with several scripts (installed to the default bin install directory) that not only demonstrate example uses but also provide functional execution.
bin
This software is released under the same terms as Perl itself. If you don't know what that means visit http://perl.com/.
Copyright (C) Michael Vincent 2015
http://www.VinsWorld.com
All rights reserved
To install Cisco::SNMP, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Cisco::SNMP
CPAN shell
perl -MCPAN -e shell install Cisco::SNMP
For more information on module installation, please visit the detailed CPAN module installation guide.