[Ssh-sftp-perl-users] Help please
Brought to you by:
dbrobins
From: +ACI-Nguyen, D. M+ACI- <dav...@xo...> - 2004-09-16 15:40:39
|
I have below script written to check disk space. I got couple errors when running it from command line. Can someone look at the script and errors and let me know why complaining about uninitialized values I have in red texts? Thanks, David ================================================================ #!usrbinperl use warnings; use Net::SSH::Perl; %city = qw(hostname xxxxx); foreach $key (sort keys %city) { print "$key\n"; my $ssh = Net::SSH::Perl->new($key, port => 22, protocol => "2,1"); $ssh->login("userlogin", "$city{$key}"); @diskspace = $ssh->cmd("df -k"); for (@diskspace) { ($diskspace) = ((split)[4]); ($diskspace) =~ (s%g); if ($diskspace >= 80) { print "$key\n $diskspace\n"; } } $ssh->cmd('exit'); } ================================================================================ HOST==> PRES0_disk_SSH.pl Argument "capacity" isn't numeric in numeric ge (>=) at PRES0_disk_SSH.pl line 30. Use of uninitialized value in split at PRES0_disk_SSH.pl line 28. Use of uninitialized value in substitution (s) at PRES0_disk_SSH.pl line 29. Use of uninitialized value in numeric ge (>=) at PRES0_disk_SSH.pl line 30. Use of uninitialized value in substitution (s) at PRES0_disk_SSH.pl line 29. Use of uninitialized value in numeric ge (>=) at PRES0_disk_SSH.pl line 30. |