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?