- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Get Idle Time for Process not attach to TTY
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-10-2011 07:17 PM
тАО02-10-2011 07:17 PM
Get Idle Time for Process not attach to TTY
I had try w but i only list the process that attach to TTY.
Thanks You.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2011 12:13 AM
тАО02-11-2011 12:13 AM
Re: Get Idle Time for Process not attach to TTY
e.g. on most systems the process "envd" will never clock up any CPU time and could certainly be defined as "idle", but if your CRAC fails in your datacenter and the temperature starts to rise, you'll be glad you had envd running to initiate a controlled shutdown.
HTH
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2011 03:04 AM
тАО02-11-2011 03:04 AM
Re: Get Idle Time for Process not attach to TTY
Thanks for your reply.
I am running my application by thin client method, when use ps command, it will show ? in the tty column and comment is runcbl.
Now i need to know the idle time in order for me to kill the user.
Thanks You.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-12-2011 02:47 AM
тАО02-12-2011 02:47 AM
Re: Get Idle Time for Process not attach to TTY
I don't see anything obvious.
You can look at time or pcpu and if not changing or 0 you could assume idle. Or State = "S".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2011 12:37 AM
тАО02-13-2011 12:37 AM
Re: Get Idle Time for Process not attach to TTY
Thanks for your reply.
Can i know the command to get the information that you give me?
Thanks You.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2011 02:30 PM
тАО02-13-2011 02:30 PM
Re: Get Idle Time for Process not attach to TTY
Sorry, these were fields of ps(1):
UNIX95=EXTENDED_PS ps -p PID -opid,pcpu,state,time,comm
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2011 04:59 PM
тАО02-13-2011 04:59 PM
Re: Get Idle Time for Process not attach to TTY
Thanks for your reply.
I need to get the command to get the idle time for me to write a program to kill the user who meet certain idle time.
Thansk You.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2011 11:50 PM
тАО02-13-2011 11:50 PM
Re: Get Idle Time for Process not attach to TTY
You have to calculate it yourself using a script. If I understand corerctly you are only interested in processes that have no tty associated with them and are called "runcbl". Well the following should get those for you:
ps -t \? | grep [r]uncbl
Now you are interested in the third column which shows cumulative process execution time. If this is not increasing the process is "probably" idle.
So you need to write a script to save the data from the command above, sleep for an hour or so, run the command again and then compare against that data.
If the cumulative execution time isn't incrementing then the process is "probably" idle. Note I say "probably", as the process could be blocked on a read for example (waiting for input from a network socket or some other form of IPC for example). So it's up to you to be confident about what processes you can and can't then go on to kill.
HTH
Duncan
I am an HPE Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-14-2011 03:49 AM
тАО02-14-2011 03:49 AM
Re: Get Idle Time for Process not attach to TTY
That's the problem, you need to write a program to get this info. A command isn't likely to provide enough info. This can only provide a start.
UNIX95=EXTENDED_PS ps -opid,pcpu,state,time,comm -C runcbl