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 ...
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| 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 |
| |||
| 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. |
| ||||
| 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 | +-----------------------------------------------------------------+ |