#!/usr/apps/perl/rhel4.x/bin/perl
use Net::SSH::Perl;
my $ssh = Net::SSH::Perl->new("server");
$ssh->login("id", "password");
my($stdout, $stderr, $exit) = $ssh->cmd(" /root/digitemp-3.6.0/digitemp_DS9097U -q -c /root/digitemp-3.6.0/digitemp.conf -a");$index=0;
my @values = split('\n', $stdout);
foreach my $val (@values) {
my @obj=split(' ',$val);
if ($#obj ==8 ){
$Temperature=$Temperature . "T$index:$obj[8] ";
$index++;
}
}
print substr($Temperature,0,length($Temperature)-1);
沒有留言:
張貼留言