My box does not seem to have the Net::SSH::Perl installed. How can I get
it installed?

His Faithful Servant,
Mark-Nathaniel Weisman
President / CEO
Infinite Visions Educational Systems Inc.
Anchorage, Alaska
http://www.ivedsys.com
[EMAIL PROTECTED]
 


-----Original Message-----
From: zentara [mailto:[EMAIL PROTECTED]] 
Sent: Monday, December 09, 2002 7:58 AM
To: [EMAIL PROTECTED]
Subject: Re: Using ssh for uptime?


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]


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

Reply via email to