Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

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 ( #1007498=note: print w/ replies, xml ) Need Help??


in reply to Need Help in NET::SSH::Perl to fetch the status of remote pid

I tried it on my system. It works for me; however, I did it a little differently:

#!/usr/bin/perl -l use strict; use warnings; use Net::SSH::Perl; my $host = 'xl-blr-03.ban'; my $user = 'mcsi_user'; my $password = 'password'; my $cmd = system("kill 0 28075; echo $?"); my $ssh = Net::SSH::Perl->new($host, debug => 1); $ssh->login($user, $password); my($stdout, $stderr, $exit) = $ssh->cmd($cmd);


Comment on Re: Need Help in NET::SSH::Perl to fetch the status of remote pid
Download Code
Re^2: Need Help in NET::SSH::Perl to fetch the status of remote pid
by Anonymous Monk on Dec 07, 2012 at 08:47 UTC

    Hello Khen. The example you posted does not see if the process is working on remote machine.When you give

     system("kill 0 28075; echo $?")

    you are seeing if the process exist on local machine and the system command will not return the output. Then the $cmd you pass it to remote machine . What I wanted is to execute the " process exist or not on remote machine . Please do help me

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1007498]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2015-07-06 07:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls