determine if user is truly idle


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers determine if user is truly idle
# 1  
Old 06-19-2008
determine if user is truly idle

I have a problem. I made a script (that I am very proud of - never scripted before) that kills off idle sessions based on who -u. The problem is it is killing sessions that aren't truly idle. who -u reports them as being idle for 7 hours, when in reality they have been using a program for that entire time. My users all run a separate program when they log in, I believe who -u is looking at tty idle time? As in when the user last entered a command on the command line? Is this true? If it matters, this is AIX 4. Thanks
# 2  
Old 06-19-2008
Log in with a second session and test it yourself Smilie
I think it's somewhat dangerous to kill idle sessions. Usually a system is not having problems with multiple accounts being logged in. Did you encounter a technical problem or is it just to keep the system "clean" from those evil idlers? Smilie Smilie In AIX 4.3.3 I remember there was some limit to parallel session set to 256 which could be just set to a higher value.
# 3  
Old 06-19-2008
No, it is just that the program we use to interact with our database (or it may be the database program itself - I'm not sure exactly) can only have 64 users on it any time. I am working on increasing that number but it is a money issue, its like $2,000 per license for each additional session.
# 4  
Old 06-19-2008
If they use a separate program, we consider that as client. So if they connect via telnet or ssh, you will see them with who -u. Usually those separate programs using a database client and use their own protocol and don't show up in the OS with.
Usually you can list connections or applications in databases themselves (at least in DB2 I am able to). If this is the case, maybe have a script running there, disconnecting the sessions via the db's commands.
# 5  
Old 06-19-2008
They either connect directly to the RS/6000 via RS232 over cat5, or telnet in to the RS/6000 with a terminal emulator (or I just use ms telnet), once they log in (they all use the same username to log into AIX) the profile for the user launches the program. Once inside the program they input their individual operator code and password and start working. I can see every connection with who -u and w. I ran my script and before I killed the sessions, I recognized my boss' IP address in the list of PID's about to be killed. who -u reported it as idle for 6 hours. He said he was doublevisioning (a remote control program for unix) to another machine and had not been idle for 6 hours at all. Is it possible to determine idle time based on physical keyboard input with shell scripting? Or will I have to learn C or some other high level language ><?
# 6  
Old 06-19-2008
Ok, I see the problem now. Sorry, I have no idea then. I bet there is a possibility to write that in C, but which library to use etc... no idea, sorry. If I come up with an idea later, I will post it.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. SCO

User process information and idle times

My company uses a proprietary GUI to its business system (Strategix) which runs on Windows clients, whereas the back-end runs on a SCO OpenServer 5.0.6a server. We're moving to a new business system next year and the business is growing and we're running out of licences on Strategix and making... (1 Reply)
Discussion started by: mmcardle
1 Replies

2. Shell Programming and Scripting

User idle time and kill

Hello.. I have many sleepy users on my Solaris box and need to kill them if they are idle for more than 45 minutes for example...I know who -u gives and the idle time but unable to make a awk line to get the condition perfect. Please help...:wall: (9 Replies)
Discussion started by: wimaxpole
9 Replies

3. Shell Programming and Scripting

Write a scripts to kill idle user for 60 min. & email user list to admin in text file

Folks, I have written one script for following condition by referring some of online post in this forum. Please correct it if I'm missing something in it. (OS: AIX 5.3) List the idle user. (I used whoidle command to list first 15 user and get username, idle time, pid and login time).... (4 Replies)
Discussion started by: sumit30
4 Replies

4. UNIX for Dummies Questions & Answers

determine total memory used by some user/process

HI guys, :confused:i would like to know how can i determine the total/approx memory used by a single user. Example Top output is below =========================================================================== top - 20:00:50 up 24 days, 2:48, 2 users, load average: 0.43, 0.40, 0.37... (3 Replies)
Discussion started by: cromohawk
3 Replies

5. UNIX for Advanced & Expert Users

To find idle time of a user

Hi All I need to find the idle time of a user... but my OS seems to be not supporting finger $ finger -sh: finger: command not found I need to find the idle time and perform some other operations... So is there any other way i can find the idle time of a user... $ uname -a... (2 Replies)
Discussion started by: Whiteboard
2 Replies

6. Shell Programming and Scripting

determine the periodfor which user is workin

write a shell script that determines the period for which a specified user is workin on the system. (3 Replies)
Discussion started by: shawz
3 Replies

7. Shell Programming and Scripting

User Idle Time

Does anyone know how do you determine the user idle time of stdin in order to log the user out for being idle too long. I would like to write a c program to do this but I it is not clear upon how to determine idle time from keyboard input. (9 Replies)
Discussion started by: cpaquette
9 Replies

8. HP-UX

How to determine cpu&memory percentage usage per user

Using HP-UX v11 Need to monitor cpu and memory usage, total for system and separately for each user in command-line mode. Found out next ways to monitor total cpu usage under hp-ux: 1) vmstat, also shows free memory 2) sar -M ps -eo user,pcpu - does not work, means 'user-defined format'... (4 Replies)
Discussion started by: hp-ux-user
4 Replies

9. UNIX for Dummies Questions & Answers

logoff idle user script

Will someone please share a script with me that will read in each line of the who -u output and if idle time is more than 50 min, execute a kill on the PID? This is what I have so far: who -u | cut -c 40-56 I am comfortable in the korn shell, but I can broaden my horizons if you've got... (4 Replies)
Discussion started by: michieka
4 Replies

10. UNIX for Dummies Questions & Answers

Killing idle user processes

I'm looking for some help, please! I'm trying to kill any idle user processes over 40 Minutes. I have tried putting TMOUT=2400 within the users .profile However this does not seem to be working. We run aix 4.3.3 with ORACLE 7.3 The above works o.k. when the user is only within the... (3 Replies)
Discussion started by: annette
3 Replies
Login or Register to Ask a Question