Re: script which should take who -i output as input and KILL

From: Randy Styka (randy_at_computron.com)
Date: 05/26/04


Date: Wed, 26 May 2004 03:32:35 GMT

Khurram Khan wrote:
>
> Hi all,
>
> I want to write a script which should take who -i output as input and
> KILL all the sessions which are idle since more then 30 minutes,
> however if user is root then script should not kill its session.
>
One thing to watch out for is the definition of idle that is
used by "who -i" or "who -u". These programs only look at
the last access of the tty device. Which means that if a user
is running a long cpu bound job with no keyboard activity,
they WILL show up as idle in these commands and you will log
them off...

To avoid this, you need to monitor cpu usage. Because of this,
we wrote (and sell) a package called LOGMON that monitors the
cpu usage for each user and their child processes. We can then
log off the truly idle users. You can vary the inactivity time
by user, time of day, etc. For details send a message to
logmon@computron.com or visit www.logmon.com

Good luck...

-- 
+-----------------------------------------------------------------+
| Computronics                   Randy Styka, randy@computron.com |
| 4N165 Wood Dale Road           Phone:  630/941-7767             |
| Addison, Illinois  60101 USA   Fax:    630/941-7714             |
+-----------------------------------------------------------------+


Relevant Pages

  • Re: Identifying disconnected user telnet sessions
    ... however my problem is not identifying who has been sitting idle for n ... but trying to identify disconnected sessions. ... between the session gets disconnected & my script catching it is what I ... database connections open at any given time. ...
    (comp.unix.shell)
  • Re: Identifying disconnected user telnet sessions
    ... > however my problem is not identifying who has been sitting idle for n ... but trying to identify disconnected sessions. ... > between the session gets disconnected & my script catching it is what I ... If they already have 2 open connections, ...
    (comp.unix.shell)
  • Reading terminal services session information
    ... Can anyone assist me with a script? ... I need to be able to see if there are any sessions ... idle, then I need to see how long the status has been idle for so that ... it doesn't provide idle time. ...
    (microsoft.public.scripting.vbscript)
  • Re: Robocopy replication
    ... are you exiting the script? ... >> Can you open the sessions on the servers to see if the open sessions are ... If they are you could kill the session as part of the ... > well they are permanently resaident in Task Manager as I'd expect from a ...
    (microsoft.public.windows.server.general)
  • Re: script which should take who -i output as input and KILL
    ... 2004-05-25, 01:58, Khurram Khan: ... > KILL all the sessions which are idle since more then 30 minutes, ... > however if user is root then script should not kill its session. ...
    (comp.unix.shell)