ssh timeout

Sutton, Harry (MSE) harry.sutton at hp.com
Fri Sep 25 15:36:11 UTC 2009


But as someone else pointed out earlier, ssh already has built-in 
mechanisms for dealing with this (TCPKeepAlive, ClientAliveInterval, 
ClientAliveCountMax), so why jump through all these other hoops to 
attain this functionality?

      /Harry

On 09/25/2009 11:16 AM, Howard, Chris wrote:
> You can kill a child process after a certain time
> has elapsed.
>
> So, you would have a parent shell script start
> up the ssh script and put it in the background (&).
> Then call sleep for some
> number of seconds.  When it wakes up if the
> child is still running ('kill -0 $pid')
> then you send it a kill signal ('kill -9 $pid').
> Use a file in /tmp for the child to pass back results
> to the parent process if it succeeds.
>
> Or, I think you could use a timeout signal
> in a perl script.
>
> Or, I think you could have the remote machine
> use ssh to put its information  onto a central
> monitoring machine periodically using cron or
> similar.  Then your monitoring program would
> just look at that centralized information and
> not do an ssh at all.
>
>
>
>    
>> -----Original Message-----
>> From: nitin.gizare at wipro.com [mailto:nitin.gizare at wipro.com]
>> Sent: Thursday, September 24, 2009 8:17 PM
>> To: redhat-sysadmin-list at redhat.com
>> Subject: ssh timeout
>>
>> HI
>>
>>
>>
>> I am running script using ssh to capture load of some parameters of
>> remote machine.
>>
>> But if one of machine is down script does not go forward and will be
>> waiting for to come up and complete ssh connections.
>>
>> I would like to set some time out in which case if machine does not
>> response it should time out on ssh and proceed for next steps.
>>
>>
>>
>> Please help me with this settings
>>
>>
>>
>> Rgds
>>
>> Nitin
>>      
>
> --
> redhat-sysadmin-list mailing list
> redhat-sysadmin-list at redhat.com
> https://www.redhat.com/mailman/listinfo/redhat-sysadmin-list
>
>    


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 6148 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/redhat-sysadmin-list/attachments/20090925/ba003db4/attachment.p7s>


More information about the redhat-sysadmin-list mailing list