ssh timeout

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


Understood - TMTOWTDI* is one of the founding principles ;-)

     /Harry

*There's More Than One Way To Do It

On 09/25/2009 11:48 AM, Howard, Chris wrote:
> I wasn't advocating a particular solution, just pointing
> out some.
>
> Since not all processes are as well apportioned as
> ssh, maybe a shell timeout technique will come in handy
> for other purposes someday.
>
> Or maybe not.
>
>
>    
>> -----Original Message-----
>> From: Sutton, Harry (MSE) [mailto:harry.sutton at hp.com]
>> Sent: Friday, September 25, 2009 9:36 AM
>> To: redhat-sysadmin-list at redhat.com
>> Subject: Re: ssh timeout
>>
>> 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
>>>
>>>
>>>        
>>      
>
> --
> 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/216f3f31/attachment.p7s>


More information about the redhat-sysadmin-list mailing list