#!/usr/local/bin/perl # # use strict; use warnings; use Net::SSH2::Cisco; my $t = Net::SSH2::Cisco->new( host => 'nexus-switch', Dump_log => '/root/dump.log', Output_log => '/root/output.log', Input_log => '/root/input.log', Waitfor_clear => '0' ); $t->login( Name => 'name', Password => 'passwd' ); # Execute Command my @output = $t->cmd(string => "show clock"); print @output; $t->close;