Unix Technical Forum

Kill more then 15 minutes idel sessions

This is a discussion on Kill more then 15 minutes idel sessions within the AIX Operating System forums, part of the Unix Operating Systems category; --> Kill users with more then 15 minutes idle time Hi We have one oracle based application installed on AIX ...


Go Back   Unix Technical Forum > Unix Operating Systems > AIX Operating System

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-04-2008, 10:32 PM
Khurram Khan
 
Posts: n/a
Default Kill more then 15 minutes idel sessions

Kill users with more then 15 minutes idle time

Hi

We have one oracle based application installed on AIX server, our
user's login into AIX server only to use that application. I want to
write a script which should forcefully kill all the users sessions
whose AIX session is idle since more then 15 minutes. By using command
f –i we get mentioned output which gives idle time details of all the
users.

Please advice how can I create a script of command to kill users whose
idle time is more then 15 minutes.

/ >f -i
Login TTY When Idle
shahidh pts/0 Wed May 12 09:28 23 minutes
nusratz pts/1 Wed May 12 08:58 2 minutes 35 seconds
shafiqur pts/2 Wed May 12 14:52 2 minutes 7 seconds
akbara pts/3 Wed May 12 09:50 10 minutes
intizar pts/4 Wed May 12 02:15 1 minute 26 seconds
zahidk pts/5 Wed May 12 08:29 2 hours 45 minutes
awahab pts/6 Wed May 12 14:50
emadn pts/7 Wed May 12 12:01 21 minutes
hanifk pts/8 Wed May 12 11:09 1 hour 1 minute
arifs pts/9 Wed May 12 08:40 45 seconds
fkouri pts/10 Wed May 12 10:59 1 hour 57 minutes
anjumk pts/11 Tue May 11 20:52 1 minute 15 seconds
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 01-04-2008, 10:32 PM
Nicholas Dronen
 
Posts: n/a
Default Re: Kill more then 15 minutes idel sessions

Khurram Khan <khurram.khan@qict.net> wrote:
KK> Kill users with more then 15 minutes idle time

KK> Hi

KK> We have one oracle based application installed on AIX server, our
KK> user's login into AIX server only to use that application. I want to
KK> write a script which should forcefully kill all the users sessions
KK> whose AIX session is idle since more then 15 minutes. By using command
KK> f ?i we get mentioned output which gives idle time details of all the
KK> users.

KK> Please advice how can I create a script of command to kill users whose
KK> idle time is more then 15 minutes.

You might do better with idled:

http://www.darkwing.com/idled/

Regards,

Nicholas
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 01-04-2008, 10:32 PM
tjchamp
 
Posts: n/a
Default Re: Kill more then 15 minutes idel sessions

khurram.khan@qict.net (Khurram Khan) wrote in message news:<a23090a4.0405120412.3bdb8e2e@posting.google. com>...
> Kill users with more then 15 minutes idle time
>
> Hi
>
> We have one oracle based application installed on AIX server, our
> user's login into AIX server only to use that application. I want to
> write a script which should forcefully kill all the users sessions
> whose AIX session is idle since more then 15 minutes. By using command
> f ?i we get mentioned output which gives idle time details of all the
> users.
>
> Please advice how can I create a script of command to kill users whose
> idle time is more then 15 minutes.
>
> / >f -i
> Login TTY When Idle
> shahidh pts/0 Wed May 12 09:28 23 minutes
> nusratz pts/1 Wed May 12 08:58 2 minutes 35 seconds
> shafiqur pts/2 Wed May 12 14:52 2 minutes 7 seconds
> akbara pts/3 Wed May 12 09:50 10 minutes
> intizar pts/4 Wed May 12 02:15 1 minute 26 seconds
> zahidk pts/5 Wed May 12 08:29 2 hours 45 minutes
> awahab pts/6 Wed May 12 14:50
> emadn pts/7 Wed May 12 12:01 21 minutes
> hanifk pts/8 Wed May 12 11:09 1 hour 1 minute
> arifs pts/9 Wed May 12 08:40 45 seconds
> fkouri pts/10 Wed May 12 10:59 1 hour 57 minutes
> anjumk pts/11 Tue May 11 20:52 1 minute 15 seconds


Why not try who -i. That gives essentially the same information in a
different format, plus their pid.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 01-04-2008, 10:35 PM
Randy Styka
 
Posts: n/a
Default Re: Kill more then 15 minutes idel sessions

Khurram Khan wrote:
>
> Kill users with more then 15 minutes idle time
>
> Hi
>
> We have one oracle based application installed on AIX server, our
> user's login into AIX server only to use that application. I want to
> write a script which should forcefully kill all the users sessions
> whose AIX session is idle since more then 15 minutes. By using command
> f –i we get mentioned output which gives idle time details of all the
> users.
>
> Please advice how can I create a script of command to kill users whose
> idle time is more then 15 minutes.
>
> / >f -i
> Login TTY When Idle
> shahidh pts/0 Wed May 12 09:28 23 minutes

...
There are programs that will help, like idled, and you can
cobble something together, but let me mention something that
might be very important...

The idle time shown above, or "who -u", etc, is based solely
on tty activity. If the user "shahidh" above is running a long
job that is cpu bound, but has no keyboard activity, they will
show up as idle. So those 23 minutes of idle time above might
not be idle; they could be doing a large database query or
something else that has no keyboard activity.

Because of this, we wrote (and sell ;-) a product called
LOGMON. This software runs as a daemon to monitor the cpu
usage for each user, and their child processes. That way we
can be sure the user really is idle before logging them off.
You can vary the inactivity time by user, time of day, etc.
You can control how the user is logged off, send warnings, etc.

If this is of interest, send a message to logmon@computron.com
for details or visit www.logmon.com

Thanks!
--
+-----------------------------------------------------------------+
| Computronics Randy Styka, randy@computron.com |
| 4N165 Wood Dale Road Phone: 630/941-7767 |
| Addison, Illinois 60101 USA Fax: 630/941-7714 |
+-----------------------------------------------------------------+
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:22 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com