05-15-2013
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 our users frustrated when they can't get in. However, with a new business system looming, I'm reluctant to spend £2,000 per extra licence.
I wanted to use the "idleout" facility of SCO to kick out users who were idling along, but Strategix uses a proprietary software interface that doesn't allow me to use the traditional UNIX facilities like "idleout" or "who" or "finger -i". Instead, it comes with it's own binary executable called "adwho", but all that does is list the user and the module in Strategix they are using.
I can use "ps -ef" or "ps -u" to get some process information, but nothing to help with clearly identifying who has been idle for x minutes.
Has anyone got any brilliant ideas?
Cheers for any help.
Mark
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Matez,
I have a list of process id's in a text file. I want to know how to find the idle time of a process which are more than 300secs and kill them accordingly.
Could you please help me to get these details. I want to write a shell script with this.
Thanks..Krish :) (36 Replies)
Discussion started by: Krrishv
36 Replies
2. UNIX for Dummies Questions & Answers
We are running AIX 5.3 and for ICICS Printing we have process called cicstermp runing whcih attaches the print to print queue
But is process is triggered when ever a print is to be given
Can we find the processes which are idle
I mean every time a print is given it creats a new cicstermp... (1 Reply)
Discussion started by: pbsrinivas
1 Replies
3. Shell Programming and Scripting
I need a script to kill those process id whose idle time is more than 30min
plz help me (3 Replies)
Discussion started by: salil2012
3 Replies
4. Shell Programming and Scripting
Hi there,
I wrote a script that scans a folder for new files.
I don't want to run it at specific times but only when the computer is NOT busy.
I tried to use nice but it doesn't really work. I mean, even if my process has less priority, it still slows down the other processes. I did a test... (3 Replies)
Discussion started by: chebarbudo
3 Replies
5. AIX
Dear Friends ,
I am using DB2 database in AIX 5.3 server . In my server some IDLE process are generated after several times which I need to kill it manually each and every time .
The process I query like following :
root@bagpuss $ ps auxw|sort -r +3|head -10
USER PID %CPU %MEM ... (3 Replies)
Discussion started by: shipon_97
3 Replies
6. Shell Programming and Scripting
I am using Ubuntu 9.04. I want to write a shell script to get the information about cpu idle from top command at the real time when i call it, compare cpu idle with 20 (20%), if cpu idle > 20 exit 1, vice versa exit 0. Anybody can help me to resolve it ?
Thanks alot. (7 Replies)
Discussion started by: huyquocnguyen
7 Replies
7. Shell Programming and Scripting
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
8. HP-UX
Hello Anyone:
I have run into an issue that I have never seen or heard of.
Recently on a specific server I have encountered a random issue that I've not been able to repliate on demand... When I view the processes status of a certain process, the information returned to the screen has a... (2 Replies)
Discussion started by: DEN1022
2 Replies
9. Shell Programming and Scripting
Hi,
I need a script that can automatically kill all processes named "webrepn" and "webrebw" if idle for more than 30 minutes.
Then I will have a Cron Job to run the script every night or 2-3 times a day depends on how this script helps.
Right now, I run "ps -ef | grep webrebn" and "kill -9... (7 Replies)
Discussion started by: MaggieL
7 Replies
10. UNIX for Dummies Questions & Answers
I noticed when having some trouble with code I was testing that the CPU was becoming exhausted and I would have to reboot. After rebooting a couple times I decided to check for other problems before trying my code again. That's when I noticed that the CPU with the idle process was through the roof:... (5 Replies)
Discussion started by: Azrael
5 Replies
LEARN ABOUT FREEBSD
rtprio
RTPRIO(2) BSD System Calls Manual RTPRIO(2)
NAME
rtprio, rtprio_thread -- examine or modify realtime or idle priority
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <sys/types.h>
#include <sys/rtprio.h>
int
rtprio(int function, pid_t pid, struct rtprio *rtp);
int
rtprio_thread(int function, lwpid_t lwpid, struct rtprio *rtp);
DESCRIPTION
The rtprio() system call is used to lookup or change the realtime or idle priority of a process, or the calling thread. The rtprio_thread()
system call is used to lookup or change the realtime or idle priority of a thread.
The function argument specifies the operation to be performed. RTP_LOOKUP to lookup the current priority, and RTP_SET to set the priority.
For the rtprio() system call, the pid argument specifies the process to operate on, 0 for the calling thread. When pid is non-zero, the sys-
tem call reports the highest priority in the process, or sets all threads' priority in the process, depending on value of the function argu-
ment.
For the rtprio_thread() system call, the lwpid specifies the thread to operate on, 0 for the calling thread.
The *rtp argument is a pointer to a struct rtprio which is used to specify the priority and priority type. This structure has the following
form:
struct rtprio {
u_short type;
u_short prio;
};
The value of the type field may be RTP_PRIO_REALTIME for realtime priorities, RTP_PRIO_NORMAL for normal priorities, and RTP_PRIO_IDLE for
idle priorities. The priority specified by the prio field ranges between 0 and RTP_PRIO_MAX (usually 31). 0 is the highest possible prior-
ity.
Realtime and idle priority is inherited through fork() and exec().
A realtime thread can only be preempted by a thread of equal or higher priority, or by an interrupt; idle priority threads will run only when
no other real/normal priority thread is runnable. Higher real/idle priority threads preempt lower real/idle priority threads. Threads of
equal real/idle priority are run round-robin.
RETURN VALUES
The rtprio() and rtprio_thread() functions return the value 0 if successful; otherwise the value -1 is returned and the global variable errno
is set to indicate the error.
ERRORS
The rtprio() and rtprio_thread() system calls will fail if:
[EFAULT] The rtp pointer passed to rtprio() or rtprio_thread() was invalid.
[EINVAL] The specified prio was out of range.
[EPERM] The calling thread is not allowed to set the realtime priority. Only root is allowed to change the realtime priority of
any thread, and non-root may only change the idle priority of threads the user owns, when the sysctl(8) variable
security.bsd.unprivileged_idprio is set to non-zero.
[ESRCH] The specified process or thread was not found or visible.
SEE ALSO
nice(1), ps(1), rtprio(1), setpriority(2), nice(3), renice(8), p_cansee(9)
AUTHORS
The original author was Henrik Vestergaard Draboel <hvd@terry.ping.dk>. This implementation in FreeBSD was substantially rewritten by David
Greenman. The rtprio_thread() system call was implemented by David Xu.
BSD
December 27, 2011 BSD