Advertisement
Guest User

Untitled

a guest
Sep 14th, 2017
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #!/usr/bin/perl
  2.  
  3. use warnings;
  4. use strict;
  5. use Net::Appliance::Session;
  6.  
  7. my $host = '<my_host>';
  8. my $user = '<my_user>';
  9. my $pass = '<my_password>';
  10.  
  11. my $session = Net::Appliance::Session->new( personality => 'cisco', host => $host, transport => 'SSH', );
  12. $session->connect( username => $user, password => $pass ) or die "Cannot Connect! : $!";
  13.  
  14. my @output = $session->cmd('show version');
  15.  
  16. $session->close;
  17.  
  18. print join("n",@output);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement