RE: [Ssh-sftp-perl-users] What is the best way to Install Net::SSH::Perl on WinXP
Brought to you by:
dbrobins
From: Bobby J. <bob...@se...> - 2006-03-30 22:43:10
|
I get the following error, if I run the scripts in Windows: Can't map service name 'ssh' to port number at memtest.pl line 8. #!/usr/bin/perl use strict; use Net::SSH::w32Perl; my $user =3D "root"; my $pass =3D "password"; my $host =3D "192.168.0.173"; my $cmd =3D "cat /proc/meminfo | grep MemFree";=20 my $ssh =3D Net::SSH::Perl->new($host);=20 $ssh->login($user, $pass); for (1..1000)=20 { my ($stdout, $stderr, $exit) =3D $ssh->cmd($cmd); my @temp =3D split /\s+/, $stdout; my $FreeMem =3D $temp[1]; Print "Current Free memory is: $FreeMem" if ($FreeMem > 10000); print "Free memory has dropped below 10K:$FreeMem" if ($FreeMem < 10000); if ($FreeMem < 2000) { print "Critical Error. Free Mem is: FreeMem"; last; } sleep 600; } |