HariTheNewMonk has asked for the wisdom of the Perl Monks concerning the following question:
Hello enlightened monks. I am new in community and I need some help. I want to know if a particular process Id is running on remote machine.But When I use the NET::SSH::Perl I get "stdout" as 0 always, irrespective of process is running or not. Please help below is my code
#!/usr/bin/perl use Net::SSH::Perl; my $host = 'xl-blr-03.ban'; my $user = 'mcsi_user'; my $password = 'password'; #-- set up a new connection my $ssh = Net::SSH::Perl->new($host); #-- authenticate $ssh->login($user, $password); #-- execute the command my($stdout, $stderr, $exit) = $ssh->cmd("kill -0 28075 ; echo $?"); print " Output is $stdout \n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need Help in NET::SSH::Perl to fetch the status of remote pid
by Khen1950fx (Canon) on Dec 06, 2012 at 08:02 UTC | |
by Anonymous Monk on Dec 07, 2012 at 08:47 UTC |