3

I wrote a Nagios check which counts how many pgpool processes are running and how long each process runs. I'm running on Linux CentOS 6.4

In order to get the time the process is running, I'm using the next command:

ps -p PID -o etime=

Example:

[root@pgpool ~]# ps -p 28737 -o etime=
   08:35:48
[root@pgpool ~]#

This is the normal output, but sometimes I get the following output and it break the script: 7-17:15:52 Example:

[root@pgpool ~]# for prc in $(ps -ef | grep pgpool | grep -v wait | grep -v PCP | awk '{print $2}'); do ps -p $prc -o etime= ; done
      40:55
   22:08:43
      23:55
   15:12:36
      20:35
 7-17:15:52
   09:34:35
29-00:56:18
[root@pgpool ~]#

So my questions are:

  • What does it mean? that the process is running between 7 to 17 hours?
  • How come the output layout is different at some times?
Keith
  • 4,637
  • 15
  • 25
Itai Ganot
  • 10,644
  • 29
  • 93
  • 146

1 Answers1

13

man ps, section etime:

etime ELAPSED elapsed time since the process was started, in the form [[dd-]hh:]mm:ss.

So your process runs for longer than a day.

Sven
  • 98,649
  • 14
  • 180
  • 226