The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Killing idle users TIA PapaBear Shell Programming and Scripting 2 01-14-2008 04:37 PM
HP-UX users get logged off while idle. Laoinjo UNIX for Advanced & Expert Users 5 06-04-2007 12:28 PM
finding idle time of a process Krrishv Shell Programming and Scripting 36 01-10-2007 09:34 AM
Idle users over 1 day pbonilla Shell Programming and Scripting 1 11-27-2006 09:07 PM
Log off idle users wtofu AIX 0 06-30-2005 10:38 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 07-06-2005
rfmurphy_6 rfmurphy_6 is offline
Registered User
  
 

Join Date: Jun 2005
Location: Cleveland, Ohio
Posts: 18
finding idle users

I am trying to write a script that will list the idle users on my system which is running HPUX 11.11. The script is currently written as :

who -u > /home/rfm/scripts/user.txt

echo " There are currently... "
wc -l /home/rfm/scripts/user.txt
echo " User logins on System : `uname -n` "

grep "0:" /home/rfm/scripts/user.txt > idle_u.txt
grep "1:" /home/rfm/scripts/user.txt >> idle_u.txt
grep "2:" /home/rfm/scripts/user.txt >> idle_u.txt
sort -u -t ',' -k 1,1 idle_u.txt
wc -l /home/rfm/scripts/idle_u.txt

echo " Users are "IDLE" "
echo " "
echo " "
echo " IDLE User Logins "
echo " ---------------- "
echo " "
cat /home/rfm/scripts/idle_u.txt | pg
echo " "
  #2 (permalink)  
Old 07-06-2005
rfmurphy_6 rfmurphy_6 is offline
Registered User
  
 

Join Date: Jun 2005
Location: Cleveland, Ohio
Posts: 18
in addition

The other problem is there are multiple logins for the users. I would use this list to determine which users to force to log out. There are at least 800 logins at any given time. I would also be looking at some sort options to determine longest idle to shortest.
  #3 (permalink)  
Old 07-06-2005
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,805
Do you know about using the TMOUT environment variable in /etc/profile?

It will handle idle process cleanup problem for you. Set it readonly, and for the number of idle seconds before the process is killed. We use 14400. If you make it too short a duration, users will do something to prevent it from working, like stay in vi all the time.
  #4 (permalink)  
Old 07-06-2005
rfmurphy_6 rfmurphy_6 is offline
Registered User
  
 

Join Date: Jun 2005
Location: Cleveland, Ohio
Posts: 18
Yes and no...

I am familiar with the " TMOUT " option I have it inserted into the profile and tested it. The option works like a charm however; the option is not used " yet " because the powers that be can not decide on a time out limit or a limit for logins. Usually they wait until users can not log in and come to me to free up sessions.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 05:06 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0