Conrol::CLI - Controlling a device by interacting with it's Command Line Interface(CLI)
=========================================================================================
A Command Line Interface (CLI) is an interface where the user is presented with a command prompt and has to enter ASCII commands to drive or control or configure that device.
That interface could be the shell on a unix system or some other command interpreter on a device such as an ethernet switch or an IP router or some kind of security appliance.
This module is useful to control/automate/script a remote device by interacting with its CLI interface remotely over any type of connection which can be used to reach the CLI interface of that remote device.
Control::CLI supports any of Telnet, SSHv2 (using an interactive shell channel) and Serial Port connections.
Much of the functionality of this module is in fact similar (and in some cases identical) to that offered by the popular Net::Telnet module. The real benefit of this module is that connection and basic I/O can be performed in a consistent manner regardless of the underlying connection type thus allowing CLI based scripts to be easily converted between or operate over any of Telnet, SSH or Serial port connection.
To do so, Control::CLI relies on these underlying modules:
Net::Telnet for Telnet access
Net::SSH2 for SSH access
Win32::SerialPort or Device::SerialPort for Serial port access respectively on Windows and Unix systems
Note that Net::SSH2 only supports SSHv2 and this class will always and only use Net::SSH2 to establish a channel over which an interactive shell is established with the remote host. This is typically the only way that SSH is implemented on ethernet switches and IP routers and other appliances. Both password and publickey authentication are supported.
Each of the above modules is optional (they are not required to install Control::CLI), however if one of the modules is missing then no access of that type will be available. For instance if Win32::SerialPort is not installed (on a Windows system) but both Net::Telnet and Net::SSH2 are, then Control::CLI will be able to operate over both Telnet and SSH, but not Serial port. There has to be, however, at least one of the above modules installed, otherwise Control::CLI's constructor will throw an error.
INSTALLATION
This module was built using Module::Build.
If you have Module::Build already installed, to install this module run the following commands:
perl Build.PL
./Build
./Build test
./Build install
Or, if you're on a platform (like DOS or Windows) that doesn't require the "./" notation, you can do this:
perl Build.PL
Build
Build test
Build install
If instead you are relying on ExtUtils::MakeMaker then run the following commands:
perl Makefile.PL
make
make test
make install
SUPPORT AND DOCUMENTATION
After installing, you can find documentation for this module with the
perldoc command.
perldoc Conrol::CLI
You can also look for information at:
RT, CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Conrol-CLI
AnnoCPAN, Annotated CPAN documentation
http://annocpan.org/dist/Conrol-CLI
CPAN Ratings
http://cpanratings.perl.org/d/Conrol-CLI
Search CPAN
http://search.cpan.org/dist/Conrol-CLI/
LICENSE AND COPYRIGHT
Copyright (C) 2010 Ludovico Stevens
This program is free software; you can redistribute it and/or modify it
under the terms of either: the GNU General Public License as published
by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.