- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to get Start Date/Time of a Process in HP-UX
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
Forums
Discussions
Discussions
Discussions
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
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
04-16-2004 02:39 AM
04-16-2004 02:39 AM
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2004 02:46 AM
04-16-2004 02:46 AM
Re: How to get Start Date/Time of a Process in HP-UX
ps has the option your looking for.
Cheers
Nicolas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2004 02:47 AM
04-16-2004 02:47 AM
Re: How to get Start Date/Time of a Process in HP-UX
Using the lstart specifier of ps shows the start date and time of a process. man ps for more info.
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2004 02:49 AM
04-16-2004 02:49 AM
Re: How to get Start Date/Time of a Process in HP-UX
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2004 02:49 AM
04-16-2004 02:49 AM
Re: How to get Start Date/Time of a Process in HP-UX
Once the time lapsed is more then 24 hrs. only start date will be shown. Only time is shown if process is less than 24 hrs. old.
man ps gives more details.
Also you can use UNIX94 variable to get required info.
UNIX95= ps -l -o "stime,args"
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2004 02:56 AM
04-16-2004 02:56 AM
Re: How to get Start Date/Time of a Process in HP-UX
'ps -ef |grep {processname}'
eg. '
# ps -ef|grep inetd
root 21490 1 0 08:28:16 ? 0:00 /usr/sbin/inetd
or 'ps -ef|grep {pid}' if you know the pid.
eg.
# ps -ef|grep 21490
root 21490 1 0 08:28:16 ? 0:00 /usr/sbin/inetd
Hope it helps
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2004 03:02 AM
04-16-2004 03:02 AM
Re: How to get Start Date/Time of a Process in HP-UX
Thank you so far for the replies.. what I am after is some fort if a tool, ie. procinfo which will show Process start DATE and TIME or EPOCH Time is possible.
ie.
Fri Apr 16 07:59:56 PDT 2004
or
1082127596 (in Epoch Time - )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2004 03:05 AM
04-16-2004 03:05 AM
Re: How to get Start Date/Time of a Process in HP-UX
root# procinfo.ksh SomeLongRunningApp
PROC STARTTIME: Fri Apr 16 07:59:56 PDT 2004
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2004 03:14 AM
04-16-2004 03:14 AM
Re: How to get Start Date/Time of a Process in HP-UX
In my previuos post using the lstart of ps gives the output you are looking for and it does not matter if the process is running for more than 24 hours. You could use this in a script so you can specify what process you want info on.
IDEV:/usr/users/pleddy/scripts>ps -efo cmd,lstart | grep sysl
/usr/sbin/syslog Tue Apr 13 11:16:45 2004
grep sysl Fri Apr 16 16:06:59 2004
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2004 03:25 AM
04-16-2004 03:25 AM
Re: How to get Start Date/Time of a Process in HP-UX
ps -efo cmd,lstart | grep sysl
does not work,
even UNIX95=1 ps -efo cmd,lstart | grep sysl
does not work. and man page for ps on HP-UX 11.11 makes no mention of "lstart" as one of the "column formats" on ps..
What UNIX are you on?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2004 03:29 AM
04-16-2004 03:29 AM
Re: How to get Start Date/Time of a Process in HP-UX
I did that on one of our Tru64 boxes and it works fine. Got a bit mixed up there, apologies.
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2004 03:33 AM
04-16-2004 03:33 AM
Re: How to get Start Date/Time of a Process in HP-UX
UNIX95=1 ps -efo etime,comm
Thanks for all your replies.....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2004 04:49 AM
04-16-2004 04:49 AM
Re: How to get Start Date/Time of a Process in HP-UX
HTH
Bruno
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-19-2004 06:07 AM
04-19-2004 06:07 AM
SolutionYou can refer to the man page on pstat for more info....
struct __pst_status {
_T_LONG_T pst_idx;/* Index for further pstat() requests */
_T_LONG_T pst_uid; /* Real UID */
_T_LONG_T pst_pid; /* Process ID */
_T_LONG_T pst_ppid; /* Parent process ID */
_T_LONG_T pst_dsize; /* # real pages used for data */
_T_LONG_T pst_tsize; /* # real pages used for text */
_T_LONG_T pst_ssize; /* # real pages used for stack */
_T_LONG_T pst_nice; /* Nice value */
struct __psdev /* TTY of this process; -1/-1 if there isn't one */
pst_term;
_T_LONG_T pst_pgrp; /* Process group of this process */
_T_LONG_T pst_pri; /* priority of process */
_T_LONG_T pst_addr; /* address of process (in memory) */
_T_LONG_T pst_cpu; /* processor utilization for scheduling */
_T_LONG_T pst_utime; /* user time spent executing (in seconds) */
_T_LONG_T pst_stime; /* system time spent executing (in seconds) */
_T_LONG_T pst_start; /* time process started (seconds since epoch) */
.........
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2004 12:42 AM
04-28-2004 12:42 AM
Re: How to get Start Date/Time of a Process in HP-UX
I've no done any C in the last 10 years.. would you mine posting a code that I could compile?
Also, would this structure (or something similar) be accessible in PERL?