| Net-Autoconfig documentation | view source | Contained in the Net-Autoconfig distribution. |
Net::Autoconfig::Device::Cisco - Perl extension for provisioning or reconfiguring network devices.
use Net::Autoconfig::Device::Cisco;
my %data = (
hostname => dev1,
username => user1,
password => pass1,
enable_password => enable1,
snmp_version => '2c',
snmp_community => 'public',
);
my $device = Net::Autoconfig::Device::Cisco->new(%data);
$device->connect();
$device->get_admin_rights();
$device->disable_paging();
$device->discover_dev_type(); # always returns Net::Autoconfig::Device::Cisco
$device->configure($config_template); # see Net::Autoconfig::Template
This essentially only overloads the expect commands and handles some of the idiosyncrasies of Cisco devices regarding login, paging, etc.
For more information, see Net::Autoconfig::Device.
All commands from Net::Autoconfig::Device are inhereted by this module. Some of the default Net::Autoconfig::Device commands are overloaded.
Create a new Net::Autoconfig::Device::Cisco object. Additional info can be configured after the object has been created. Pass an array with ( key1 => value1, key2 => value2, ...) to initialize the object with those key values.
Connect to the device using the specified method, username and password
Returns: Success = undef Failure = reason why it failed (aka true)
Returns the class of the object. Useful if you want to know what the specific module/class of this device.
Gain administrative rights on this device using the specified
password/credentials. In the case of Cisco devices, this uses
the enable command. If admin access is already granted,
this keeps it the same.
Returns: Success = undef Failure = reason why it failed (aka true)
Disable paging on the terminal. I.e. make it so the switch doesn't prompt to see the next screen of output. It just writes it all to the screen.
In case you wanted to know, the Cisco command for doing this is
terminal length 0
Returns: Success = undef Failure = reason why it failed (aka true)
Net::Autoconfig, Net::Autoconfig::Device, and Net::Autoconfig::Template
Kevin Ehlers <kevin@uoregon.edu>
Copyright (C) 2008 by Kevin Ehlers, University of Oregon. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.8 or, at your option, any later version of Perl 5 you may have available.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
| Net-Autoconfig documentation | view source | Contained in the Net-Autoconfig distribution. |