On Sun, 8 Dec 2002 23:14:36 -0900, [EMAIL PROTECTED] (Mark-Nathaniel
Weisman) wrote:

>Mark,
>  I've got the code you sent installed and working (or almost working
>anyway) snippet below:

>I'm trying to get this silly thing working, so any ideas or suggestions
>are more than appreciated.
Hi,
I used the other suggestion of using Net::SSH::perl and have this
code working. (minus any html output )
##############################################################
#!/usr/bin/perl
use strict;
use warnings;
use Net::SSH::Perl;

my $user = "zzz";
my $password = "zzztester";
my @hosts = qw(localhost zentara.zentara.net);

foreach my $host (@hosts){
my $cmd = "/usr/bin/uptime";
my $ssh = Net::SSH::Perl->new( $host, port => 22);
$ssh->login($user,$password);

my($out) = $ssh->cmd($cmd);
my ($time,$uptime) = (split /\s+/,$out)[1,3];
chop $uptime;
print "$host has been up $uptime\n";
}
############################################################### 

Output:

localhost has been up 4:28
zentara.zentara.net has been up 4:28
  




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to