Xymon Mailing List Archive search

Checking process longevity

list John Glowacki
Thu, 20 Mar 2008 17:07:26 -0400
Message-Id: <user-bda821fdfa1b@xymon.invalid>

On Tue, Feb 5, 2008 at 7:58 AM, Henrik Stoerner <user-ce4a2c883f75@xymon.invalid> wrote:
On Tue, Feb 05, 2008 at 01:47:07PM +0900, Coe, Colin C. (Unix Engineer) wrote:
I do think that there are other cases
where monitoring how long a process exists is useful.

I was thinking that this could be done by adding a new flag to 'PROC' in
hobbit-clients.cfg.  Something like:

PROC processname minimumcount maximumcount color [TRACK=id] [TEXT=text]
[RUNTIME=seconds]

Example, alert if a 'df' has existed for more 60 seconds

HOST foo>
      PROC df RUNTIME=60
 Sure. Only problem is: How do you determine how long a process has
 existed ?

 Some systems report the start-time of a process in a separate column
 (START in Linux, STIME in Solaris, ...) Not very accurate, since if they
 were started more than 24 hours ago it shows only the date. I guess we
 could use that.


 Regards,
 Henrik
If etime was added to ps command this could be added to Solaris and
Linux for this purpose. stime seems like it would report month day or
year depending on OS and time passed.

Solaris man for ps:
     etime In the POSIX locale, the elapsed time since  the  pro-
           cess was started, in the form:
           [[dd-]hh:]mm:ss

Example output for different times.
   STIME     ELAPSED
Mar18  2-03:45:15
Mar19  1-06:56:27
14:45    02:08:04
15:33    01:20:22
16:25       28:27
16:53       00:29
16:53       00:00

SunOS 5.7
   STIME     ELAPSED
  May_04 686-03:00:28

SunOS 5.9
   STIME     ELAPSED
  Mar_08 377-21:30:03

SunOS 5.10
   STIME     ELAPSED
  Jun_12 282-01:43:14

Red Hat Enterprise Linux AS release 3
Linux 2.4.21-47.ELsmp
STIME     ELAPSED
Mar15  5-02:51:34

Red Hat Enterprise Linux AS release 4
Linux 2.6.9-34.ELsmp
STIME     ELAPSED
 2007 203-00:13:39

I found etime today because I had to prove processes started on a
Solaris system on Feb_20 of 2007 and not Feb_20 2008.

Hope this is helpful.

John