LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-11-2011, 11:58 PM   #1
ali2011
Member
 
Registered: Nov 2011
Location: USA, CA
Distribution: Ubuntu+Fedora
Posts: 80

Rep: Reputation: Disabled
SSH Backward Connection:


I have a control unit to about 150 PCs globally distributed, and I am facing a trouble to send WARNING signal to the main machine. the word trouble for me means: A remote host has killed an active iperf process for some reason. It's to difficult to watch or even monitor these troubles manually, and reactivate any killed process using a new shh-connection. What I look to do is as following:

If any node in the grope trying to probe a node that killed its iperf daemon, and received an error message "write failed: Connection refused", then the one received the error message should inform the main machine to reactivate the killed ipref on that node using SHH connection. By the way, EVERY node in doing active probing IS on active SSH session with the main machine (I have no idea about to send this WARNING on this active session). The idea should contain two short scripts, 1st is an active alarm all time on each PC from the 150, and the 2nd is a re-activator at the main machine to reactivate iperf on that particular machine.


I will greatly appreciate your response.
 
Old 12-12-2011, 05:36 AM   #2
asimba
Member
 
Registered: Mar 2005
Location: 127.0.0.0
Distribution: Red Hat / Fedora
Posts: 355

Rep: Reputation: 42
my 2 cents - main machine/server can poll all these 150 systems after every n minutes.
or
Machines themselves can check for this process via cron - and restart if need be.
or
And these all 150 machines can run a short custom xinetd daemon on user defined port - which on server request restarts iperf
 
Old 12-12-2011, 10:48 AM   #3
ali2011
Member
 
Registered: Nov 2011
Location: USA, CA
Distribution: Ubuntu+Fedora
Posts: 80

Original Poster
Rep: Reputation: Disabled
Can you explain with an example? I'm not that strong in programming. If the remote machine can check by itself then much efforts will be avoided but how?
 
Old 12-12-2011, 10:59 AM   #4
asimba
Member
 
Registered: Mar 2005
Location: 127.0.0.0
Distribution: Red Hat / Fedora
Posts: 355

Rep: Reputation: 42
I can suggest you a bit - you might want to do coding part your

cron - is akin to windows scheduler

ps aux / other switches + grep - let you know if process is running - if running then what state zombie etc.


Also you might want to check for earlier threads

http://www.linuxquestions.org/questi...-start-787605/


Following is code excerpt from same thread - seems a good one.

Code:
#!/bin/bash

SPHINXPID=$(pgrep searchd)


if [[ -z "$SPHINXPID" ]]; then
  /usr/local/sphinx/bin/searchd
fi

unset SPHINXPID

Last edited by asimba; 12-12-2011 at 11:01 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ssh: connection to host port: 22: Connection timed out lost connection cucolin@ Linux - Server 4 11-22-2011 06:15 AM
ssh connection forces password change, then closes connection loadedmind Linux - Newbie 2 02-16-2011 01:24 PM
LXer: ssh-xfer: Quickly grabbing files over an existing SSH connection LXer Syndicated Linux News 0 08-08-2008 03:11 PM
ssh connection refused - trying to set up ssh server at home openSauce Linux - Server 10 10-18-2007 04:38 PM
Backward compatibility lenucks General 4 06-27-2004 02:34 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration