Net-Appliance-Session-4.300001000755000765000024 013212313524 15562 5ustar00oliverstaff000000000000Net-Appliance-Session-4.300001/Build.PL000444000765000024 215113212313524 17212 0ustar00oliverstaff000000000000use strict; use warnings; use Module::Build; Module::Build->new( module_name => 'Net::Appliance::Session', author => 'Oliver Gorwits ', license => 'perl', dynamic_config => 1, configure_requires => { 'Module::Build' => '0.42', }, build_requires => { 'ExtUtils::CBuilder' => '0', }, requires => { "Cwd" => 0, "Data::Dumper" => 0, "Getopt::Long" => "2.24", "IO::Handle" => 0, "IO::Prompt::Tiny" => 0, "Moo" => 0, "Moo::Role" => 0, "MooX::Types::MooseLike::Base" => 0, "Net::CLI::Interact" => "2.300002", "Sub::Quote" => 0, "Term::ANSIColor" => 0, "Term::ReadPassword" => 0, "Text::Glob" => 0, "Text::ParseWords" => 0, "Try::Tiny" => 0, "strict" => 0, "warnings" => 0 }, test_requires => { 'Test::More' => '0.88', }, script_files => [ 'bin/nas', ], share_dir => 'share', meta_merge => { resources => { bugtracker => 'https://github.com/ollyg/Net-Appliance-Session/issues', repository => 'https://github.com/ollyg/Net-Appliance-Session', }, }, )->create_build_script; Net-Appliance-Session-4.300001/Changes000444000765000024 2616513212313524 17244 0ustar00oliverstaff0000000000004.300001 2017-12-07 * #34 Support list or single value to add_library option 4.300000 2017-10-14 * #29 make session wake_up type into integer (A. Zangerl) 4.200003 2017-02-02 * Fix for use of cloginrc in nas script (B. West) 4.200002 2015-05-18 * Change shebang line in nas script 4.200001 2015-05-14 * Remove dangerous use lib from nas script (ppisar) 4.200000 2015-01-06 * Migrate away from Dist::Zilla 4.142720 2014-09-29 19:44:29 Europe/London * Docs update for Cisco NX-OS which has max terminal of 511 4.140230 2014-01-23 20:48:04 Europe/London * [RT#92376] timeout when incorrect privileged password 4.131260 2013-05-06 20:36:23 Europe/London * Minor fix for incorrect data type on timeout 4.131210 2013-05-01 21:45:36 Europe/London * Expose global timeout setting * Add nci_options setting for passing not-natively-supported options to NCI 4.122741 2012-09-30 15:05:51 Europe/London * Bug fix for info messages in nas script 4.122740 2012-09-30 14:35:47 Europe/London * RANCID .cloginrc support for nas script 4.122730 2012-09-29 23:56:37 Europe/London * Add scripting system bin/nas * Export Try::Tiny methods as better alternative to eval() * Update for the prompts named "prompt" which are now called "generic" * Improve documentation on use of custom phrasebook libraries 4.122630 2012-09-19 17:23:45 Europe/London * Port from Moose to Moo * Remove APIv2 back-compat module 3.122530 2012-09-09 15:54:04 Europe/London * should be checking for "user" prompt not macro! * alter default suggested log level to 'notice' 3.122100 2012-07-29 00:44:52 Europe/London * Support serial console servers where the console might be asleep (C. Tucker) 3.122010 2012-07-19 20:50:58 Europe/London * Try enable_paging and disable_paging macros before generic 'paging' (C. Tucker) * Add links to transport man pages in documentation. 3.121640 2012-06-12 23:24:42 Europe/London * Library version number is logged at instatiation. 3.121570 2012-06-05 19:56:02 Europe/London * Change async interface put() to be say() because of the auto-newline * If connection fails, the transport (ssh, telnet, etc) error is emitted * Do not run disconnect macro when connect fails (J. Whitten) 3.120580_001 2012-02-27 21:47:51 Europe/London * Implement async interface - put() and gather() (rt.cpan #75201) 3.120560 2012-02-25 17:20:36 Europe/London * fix POD typo and add NAME to APIv2 (C. Vicente) * fix Win32 path for plink.exe 3.113610 2011-12-27 00:54:02 Europe/London * New implementation of output parser. Note the following: For the cmd() and macro() methods: In scalar context all data is returned. In list context the gathered response is returned as a list of lines. In both cases your local platform's newline character will end all lines. 3.113600 2011-12-26 16:36:25 Europe/London * Issue disconnect macro if the phrasebook has one, on close() * Fix bug in privileged_password implementation (reported by Paul Niemi) 3.112610 2011-09-18 10:42:28 Europe/London * Add more tests for found bugs * Add note to POD about terminal width (Mathias) 3.112600 2011-09-17 14:24:53 Europe/London * Add test for pipe in command (V. Foitzik) 3.112510 2011-09-08 22:06:06 Europe/London * Added privileged_password option (J. Roth rt.cpan#69139) 3.112290 2011-08-17 20:16:43 Europe/London * Added native last_prompt (on request of G.Peirce) 3.112190 2011-08-07 22:20:13 Europe/London * Make add_library work (for scalar only) 3.111690 2011-06-18 08:24:15 Europe/London * Fix incorrect username accessor method name (cvicente rt.cpan #68897) * Loosen type constraint on connect_options (cvicente rt.cpan #68899) 3.111600 2011-06-09 11:08:43 Europe/London * Add delegation methods for Net::Telnet to APIv2 * Tidy and fix a couple of things in the example script 3.111590 2011-06-08 23:28:03 Europe/London * Implement v2 API compat layer 3.111530 2011-06-02 23:45:26 Europe/London * Ported to Net::CLI::Interact backend 2.111080 2011-04-18 10:13:04 Europe/London * Spot login auth failures, Steve C. (rt.cpan #67487) 2.110470 2011-02-16 19:23:54 Europe/London * Prevent close() unless already opened, Steve C. (rt.cpan #65453) 2.110090 2011-01-09 11:14:48 Europe/London * Fix bug in use of close_called, Steve C. (rt.cpan #64450) 2.103641 2010-12-30 21:28:09 Europe/London * Observe output_record_separator, thanks Steve C. (rt.cpan #55187) * Protect against death spiral in timeout/close, also Steve C. (rt.cpan #53796) * Implement privileged_pagin method to manage ASA/PIX 7+ - Paul Graydon (rt.cpan #63359) 2.103640 2010-12-30 20:54:56 Europe/London * Port to Dist::Zilla libnet-appliance-session-perl (1.36) UNRELEASED; urgency=low * Add import of WNOHANG symbol from POSIX (reported by Dominik Gehl) -- Oliver Gorwits Fri, 23 Jan 2009 08:32:13 +0000 libnet-appliance-session-perl (1.35) UNRELEASED; urgency=low * Fix again for imported POSIX symbols on CENTOS 5 (reported by Dominik Gehl) -- Oliver Gorwits Wed, 31 Dec 2008 12:10:22 +0000 libnet-appliance-session-perl (1.34) UNRELEASED; urgency=low * Fix pod to mention new supported devices (JUNOS, HP, Nortel) -- Oliver Gorwits Tue, 30 Dec 2008 22:45:48 +0000 libnet-appliance-session-perl (1.33) UNRELEASED; urgency=low * Mention enable_paging and disable_paging methods (RT#40783) * Do not import symbols from POSIX (reported by Dominik Gehl) -- Oliver Gorwits Tue, 30 Dec 2008 22:08:13 +0000 libnet-appliance-session-perl (1.32) UNRELEASED; urgency=low * Fix bug in Telnet with no username (RT.cpan #40229) thanks to mstefanov -- Oliver Gorwits Sat, 8 Nov 2008 21:12:38 +0000 libnet-appliance-session-perl (1.31) UNRELEASED; urgency=low * Move to using Module::Install * Update License to be same terms as Perl -- Oliver Gorwits Sat, 8 Nov 2008 17:08:58 +0000 libnet-appliance-session-perl (1.26) UNRELEASED; urgency=low * Make all method params case insensitive (requested by raimundh) (this follows what Net::Telnet does) -- Oliver Gorwits Tue, 2 Sep 2008 13:16:34 +0100 libnet-appliance-session-perl (1.25) UNRELEASED; urgency=low * Fix the buggy SIGCHLD handler (reported by Andrew D. Clark) -- Oliver Gorwits Sun, 17 Aug 2008 18:33:23 +0100 libnet-appliance-session-perl (1.24) UNRELEASED; urgency=low * Add use of FileHandle in the Transport - seems to be a 5.10 issue? -- Oliver Gorwits Fri, 18 Jul 2008 14:08:27 +0100 libnet-appliance-session-perl (1.23) UNRELEASED; urgency=low * Added support for debugging shell on failure, see Devel::REPL::Plugin::NAS -- Oliver Gorwits Tue, 3 Jun 2008 17:41:01 +0100 libnet-appliance-session-perl (0.22) UNRELEASED; urgency=low * Add disconnect method to Transport, as a noop except for Serial (see RT.cpan#35937) -- Oliver Gorwits Sat, 17 May 2008 20:28:32 +0100 libnet-appliance-session-perl (0.21) unstable; urgency=low * Send SIGKILL to child if we're running in cygwin * Minor fix to typo in Cookbook -- Oliver Gorwits Sat, 2 Feb 2008 19:12:28 +0000 libnet-appliance-session-perl (0.19) unstable; urgency=low * Bug fix for not setting last prompt (thx miky) * Minor change to docs to mention setting in_foo_mode -- Oliver Gorwits Sat, 19 Jan 2008 21:51:29 +0000 libnet-appliance-session-perl (0.18) unstable; urgency=low * Now automatically reap child processes -- Oliver Gorwits Sun, 23 Dec 2007 14:35:03 +0000 libnet-appliance-session-perl (0.17) unstable; urgency=low * Minor fixes to Cookbook POD to improve CPAN rendering. -- Oliver Gorwits Tue, 4 Dec 2007 21:08:00 +0000 libnet-appliance-session-perl (0.16) unstable; urgency=low * Add Cookbook courtesy of Nigel Bowden. -- Oliver Gorwits Tue, 4 Dec 2007 19:06:00 +0000 libnet-appliance-session-perl (0.15) unstable; urgency=low * Users report that the child reaping isn't stable across all systems, so revert to old system of doing nothing -- Oliver Gorwits Tue, 3 Jul 2007 16:40:00 +0100 libnet-appliance-session-perl (0.14) unstable; urgency=low * Allow SSH Transport to handle username prompts, suggestion courtesy of Nigel Bowden * Set Unix systems to automatically reap child processes -- Oliver Gorwits Tue, 3 Jul 2007 13:23:00 +0100 libnet-appliance-session-perl (0.13) unstable; urgency=low * Bug in my use of Class::Data::Inheritable. A schoolboy-error :( -- Oliver Gorwits Mon, 29 Jan 2007 16:48:00 +0000 libnet-appliance-session-perl (0.12) unstable; urgency=low * Bug in SSH Transport which would catch someone out one day -- Oliver Gorwits Sun, 28 Jan 2007 23:46:00 +0000 libnet-appliance-session-perl (0.11) unstable; urgency=low * Add CheckPB option to allow (almost) complete disabling of phrasebook entry checks * Separate out phrasebook entry checking in case not all required (e.g. not going to use configure mode) * Add special named argument to cmd() allowing operation more like Net::Telnet's waitfor() * Add Opts option to SSH Engine to support arbitrary openssh args -- Oliver Gorwits Sun, 28 Jan 2007 20:54:00 +0000 libnet-appliance-session-perl (0.09) unstable; urgency=low * Remove all hard-coded command phrases and prompt regexps, they are now pulled from the loaded phrasebook so can be overridden * Check all phrases are actually in the loaded phrasebook at instantiation time and die if any are not available * As a result, now require Net::Appliance::Phrasebook >= 0.07 * Allow user to disable login (user/pass) negotiation e.g. for public route servers * Also allow user to disable paging management, or override the number of lines used to re-enable paging * Also allow user to disable privileged and configure modes (see docs) * New Transport for Serial Line access, called 'Serial' (not tested much) * New Transport for Telnet access, called 'Telnet' (not tested much) * Factor out the IO::Pty code into Transport base class. Also checked it out, and it's actually pretty sane, so can stay in. -- Oliver Gorwits Tue, 14 Nov 2006 11:59:00 +0000 libnet-appliance-session-perl (0.05) unstable; urgency=low * Major rewrite - move Phrasebook out into Net::Appliance::Phrasebook - remove all the require guff and have it properly inheriting namespaces - rewrite Exception class into a module -- Oliver Gorwits Tue, 19 Sep 2006 18:16:17 +0100 libnet-appliance-session-perl (0.01) unstable; urgency=low * Initial Release. -- Oliver Gorwits Tue, 11 Jul 2006 18:16:17 +0100 Net-Appliance-Session-4.300001/MANIFEST000444000765000024 106313212313524 17050 0ustar00oliverstaff000000000000bin/nas Build.PL Changes examples/example-1.pl lib/Net/Appliance/Session.pm lib/Net/Appliance/Session/Async.pm lib/Net/Appliance/Session/Engine.pm lib/Net/Appliance/Session/Scripting.pm lib/Net/Appliance/Session/Transport.pm MANIFEST This list of files META.json META.yml t/10-use.t t/author-10_route_server.t t/author-12_route_server_nonblock.t t/author-20_local_device.t t/author-22_local_privileged_pass.t t/author-30_local_device_ssh.t t/author-31_local_device_ssh_extra.t t/author-32_sdf_shell.t t/author-41_ssh_unknown_host.t t/author-42_ssh_fail_close.t Net-Appliance-Session-4.300001/META.json000444000765000024 476113212313524 17350 0ustar00oliverstaff000000000000{ "abstract" : "Run command-line sessions to network appliances", "author" : [ "Oliver Gorwits " ], "dynamic_config" : 1, "generated_by" : "Module::Build version 0.4224", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Net-Appliance-Session", "prereqs" : { "build" : { "requires" : { "ExtUtils::CBuilder" : "0" } }, "configure" : { "requires" : { "Module::Build" : "0.42" } }, "runtime" : { "requires" : { "Cwd" : "0", "Data::Dumper" : "0", "File::ShareDir" : "1.00", "Getopt::Long" : "2.24", "IO::Handle" : "0", "IO::Prompt::Tiny" : "0", "Moo" : "0", "Moo::Role" : "0", "MooX::Types::MooseLike::Base" : "0", "Net::CLI::Interact" : "2.300002", "Sub::Quote" : "0", "Term::ANSIColor" : "0", "Term::ReadPassword" : "0", "Text::Glob" : "0", "Text::ParseWords" : "0", "Try::Tiny" : "0", "strict" : "0", "warnings" : "0" } }, "test" : { "requires" : { "Test::More" : "0.88" } } }, "provides" : { "Net::Appliance::Session" : { "file" : "lib/Net/Appliance/Session.pm", "version" : "4.300001" }, "Net::Appliance::Session::Async" : { "file" : "lib/Net/Appliance/Session/Async.pm", "version" : "4.300001" }, "Net::Appliance::Session::Engine" : { "file" : "lib/Net/Appliance/Session/Engine.pm", "version" : "4.300001" }, "Net::Appliance::Session::Scripting" : { "file" : "lib/Net/Appliance/Session/Scripting.pm", "version" : "4.300001" }, "Net::Appliance::Session::Transport" : { "file" : "lib/Net/Appliance/Session/Transport.pm", "version" : "4.300001" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/ollyg/Net-Appliance-Session/issues" }, "license" : [ "http://dev.perl.org/licenses/" ], "repository" : { "url" : "https://github.com/ollyg/Net-Appliance-Session" } }, "version" : "4.300001", "x_serialization_backend" : "JSON::PP version 2.94" } Net-Appliance-Session-4.300001/META.yml000444000765000024 313313212313524 17170 0ustar00oliverstaff000000000000--- abstract: 'Run command-line sessions to network appliances' author: - 'Oliver Gorwits ' build_requires: ExtUtils::CBuilder: '0' Test::More: '0.88' configure_requires: Module::Build: '0.42' dynamic_config: 1 generated_by: 'Module::Build version 0.4224, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Net-Appliance-Session provides: Net::Appliance::Session: file: lib/Net/Appliance/Session.pm version: '4.300001' Net::Appliance::Session::Async: file: lib/Net/Appliance/Session/Async.pm version: '4.300001' Net::Appliance::Session::Engine: file: lib/Net/Appliance/Session/Engine.pm version: '4.300001' Net::Appliance::Session::Scripting: file: lib/Net/Appliance/Session/Scripting.pm version: '4.300001' Net::Appliance::Session::Transport: file: lib/Net/Appliance/Session/Transport.pm version: '4.300001' requires: Cwd: '0' Data::Dumper: '0' File::ShareDir: '1.00' Getopt::Long: '2.24' IO::Handle: '0' IO::Prompt::Tiny: '0' Moo: '0' Moo::Role: '0' MooX::Types::MooseLike::Base: '0' Net::CLI::Interact: '2.300002' Sub::Quote: '0' Term::ANSIColor: '0' Term::ReadPassword: '0' Text::Glob: '0' Text::ParseWords: '0' Try::Tiny: '0' strict: '0' warnings: '0' resources: bugtracker: https://github.com/ollyg/Net-Appliance-Session/issues license: http://dev.perl.org/licenses/ repository: https://github.com/ollyg/Net-Appliance-Session version: '4.300001' x_serialization_backend: 'CPAN::Meta::YAML version 0.018' Net-Appliance-Session-4.300001/bin000755000765000024 013212313524 16332 5ustar00oliverstaff000000000000Net-Appliance-Session-4.300001/bin/nas000555000765000024 1030413212313524 17214 0ustar00oliverstaff000000000000#!perl use strict; use warnings FATAL => 'all'; use Net::Appliance::Session::Scripting; Net::Appliance::Session::Scripting::run(); =pod =head1 NAME nas - Create Reusable Session Scripts =head1 SYNOPSIS $ nas --help nas [options] [hostname or IP] -p, --personality Device (default: "ios") -t, --transport method (Serial, Telnet, default: SSH) -u, --username to connect as on device (default: $USER) -R, --record Record session -P, --playback Play back session -s, --script When recording, save playback script to this -l, --cmdlog NAS to record commands to, or play them back from -e, --exit-last Num. of output lines from last command is program exit status -c, --cloginrc RANCID cloginrc with device credentials -z, --nopassword Do not ask for device password (if not using cloginrc) -o, --echo Echo commands sent, when playing back the recorded script/cmdlog -M, --paging Do not attempt to disable command output paging -B, --nobanner Suppress display of any login banner received from the device -q, --quiet Hide informational messages -v, --verbose NCI log ("debug", "notice", "info", etc) -V, --version Display this program's version number -h, --help Display this help text =head1 DESCRIPTION Use this program to help write reusable L scripts, play them back, and also to more easily connect to network devices. =over 4 =item * Start a connection to a network device using CLI switches, and prompts for credentials. This is easier than writing short Perl programs. =item * Record a set of commands issued to one network device into a command log, then replay that log against other devices (C<< -R -l >> and C<< -P -l >>). =item * Record a session and produce a Perl script which when run, replays the session to the same host, or overridable to other devices (C<< -R -s