LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-20-2003, 04:52 PM   #1
luciji
LQ Newbie
 
Registered: May 2003
Posts: 5

Rep: Reputation: 0
Question Monitoring telnet sessions


My network users connect to our Redhat Advanced Server 2.1 system via telnet to access a database application. My fear is that sooner or later, one of these users will give the three finger salute to windows while they have a file locked, freezing the db for other users.

I have tested this theory, and it seems valid. Redhat doesn't take much notice when a connected machine dies. This doesn't seem to be a good way to keep a well sorted database intact.

So, does anyone have a trick that applies a daemon that is capable of sniffing out either a dead pc, or a non-existent session, or a locked up pc, then terminating the telnet session? I can terminate these sessions when users actually call me and tell me they have a problem, but sooner or later, someone will not call, and things can get messed up.

Anyone done this, or something similar?
 
Old 05-21-2003, 03:41 PM   #2
tarballedtux
Member
 
Registered: Aug 2001
Location: Off the coast of Madadascar
Posts: 498

Rep: Reputation: 30
Well, of there is a way to monitor if the session has been active. Then you could either configure telnetd to drop all inactive connections after 2-3 minutes. That's only if the database is only accessed for a short burst of time and them usually terminated. Or make a nifty shell script to see how long a user has been idle then drop him.
 
Old 05-22-2003, 09:29 AM   #3
luciji
LQ Newbie
 
Registered: May 2003
Posts: 5

Original Poster
Rep: Reputation: 0
I'm not sure I understood.

Unfortunately, the users leave their telnet app up all day, and access the database as needed. So monitoring if there has been any activity from the user (input at their console) will not work in our situation.

As far as dropping idle sessions, I haven't seen that linux even takes note if a user terminal is offline, locked up, or even turned off. The telnet app stays active, and any locked files stay locked.

Thanks for the response, though.
 
Old 05-22-2003, 01:40 PM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
At work we have an HPUX bot that has the same sort of setup. Like you we rely on users telling us about disconnections. We also take a look to see who is logged on to see if there are any users in twice.

Can you not write a procedure in your database app that will kill a users db lock if they have been idle for too long?
 
Old 05-22-2003, 02:06 PM   #5
luciji
LQ Newbie
 
Registered: May 2003
Posts: 5

Original Poster
Rep: Reputation: 0
I imagine that could be done. I was just hoping that as configurable as Linux is, I should be able to sense/control this aspect of the server.

I looked at Telnet itself, and it seems like there are built in tools for this, if implemented. Like a keep-alive signal. I am not a programmer though, and have no idea how to make RedHat utilize this feature.

I'll keep looking and see what I can find out. I can't be the first person in the world who has found a need for this feature.

Thanks for your interest.
 
Old 05-22-2003, 03:28 PM   #6
tarballedtux
Member
 
Registered: Aug 2001
Location: Off the coast of Madadascar
Posts: 498

Rep: Reputation: 30
I just googled you problem. Look at a program called: idled or idle_watch.

Go here to get it.

http://www.ibiblio.org/pub/Linux/system/admin/idle/!INDEX.short.html
 
Old 05-22-2003, 09:16 PM   #7
bastard23
Member
 
Registered: Mar 2003
Distribution: Debian
Posts: 275

Rep: Reputation: 30
luciji,

The telnet option for keep alive is actually setting a socket option for this. It's not specific to telnet, it is a feature of TCP. Look at the file <kernel src>/Documentation/networking/ip-sysctl.txt (I'm sure it's on the web somewhere.) Specifically, 'tcp_keepalive_time' and the ones directly after it. I'm not sure how far you can get it down. I believe the default won't close the connection for ~2 hours. Try testing it on another machine as this is a system wide setting, not just port 23.

Another thing to look at is the application they are running (I'm assuming it's not sh). If you can get it to send out data regularly, like refreshing the screen, or displaying time, then the server should notice lost connections much faster. You can tune that timing as well.

Is the db locking per user? Perhaps you can kill the old telnet when they login again?

Hope that helps,
chris
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Multiple Telnet Sessions rjcrews General 4 07-24-2005 05:07 PM
No. of telnet sessions zatka Linux - Networking 2 01-16-2005 03:36 AM
Commands not available under telnet sessions? paranoidpenguin Linux - Networking 4 09-23-2004 10:11 PM
Logging telnet sessions Cynric Linux - General 2 08-14-2004 02:39 AM
telnet sessions acid_kewpie Linux - Newbie 7 07-17-2001 03:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:47 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration