我需要编写一个Perl程序,它将连接到主机系统,检查该系统的磁盘空间,并发送邮件警报。
我已经安装了Perl模块Net::SSH::Perl
,我编写了这个程序
#!usr/bin/perl
use strict;
use Net::SSH::Perl;
my $host = "abcd.xyx.net";
my $ssh = Net::SSH::Perl->new($host);
my $username = "xyzuser";
my $password = "xyz2017";
my $cmd = "/bin/ls";
$ssh->login($username, $password);
$ssh->cmd($cmd);
但是我收到以下错误:
Can't locate object method "exchange" via package "Net::SSH::Perl::Kex::DHGEXSHA256" at /usr/local/lib64/perl5/Net/SSH/Perl/Kex.pm line 107.