- edited description
Procmatch PID column show five digits only
Hello Tildeslash,
based on Monit 5.26.0 I get the following (useless) procmatch list.
monit -B procmatch "/bin/ksh ./loop.*"
List of processes matching pattern "/bin/ksh ./loop.*":
PID PPID Command
10... 1 /bin/ksh ./loop.sh
10... 1 /bin/ksh ./loopim24dca.sh
10... 1 /bin/ksh ./looptrdca.sh
11... 1 /bin/ksh ./loopdigidca.sh
12... 1 /bin/ksh ./loopscddca.sh
17... 1 /bin/ksh ./loopiflogserver.sh
17... 1 /bin/ksh ./loopifdca.sh
* 19... 1 /bin/ksh ./loop.sh
65915 1 /bin/ksh ./loopposdca.sh
Total matches: 9
WARNING:
Multiple processes match the pattern. Monit will select the process with the
highest uptime, the one highlighted.
Everything is well, but the column for the PID/PPID is to small, only five digits are shown, but my Linux use six digits.
www 65915 1 0 2019 ? 00:00:00 /bin/ksh ./loopposdca.sh
www 101756 1 0 2019 ? 00:00:00 /bin/ksh ./loop.sh
www 103995 1 0 2019 ? 00:00:00 /bin/ksh ./loopim24dca.sh
www 104246 1 0 2019 ? 00:00:00 /bin/ksh ./looptrdca.sh
www 113313 1 0 2019 ? 00:00:00 /bin/ksh ./loopdigidca.sh
www 126074 1 0 2019 ? 00:00:00 /bin/ksh ./loopscddca.sh
www 176187 1 0 15:19 ? 00:00:00 /bin/ksh ./loopiflogserver.sh
www 176245 1 0 15:19 ? 00:00:00 /bin/ksh ./loopifdca.sh
www 197642 1 0 2019 ? 00:00:00 /bin/ksh ./loop.sh
From my point of view it is a mistake in general for several Unix systems, PIDs are greater than 32767 since several years, for Linux a popular value is 262143 and the max PID is 4194303.
For Linux the max PID size is 5 to 7 digits.
For AIX the max PID size is 7 or 8 digits.
And for MacOS X the max PID size is 5 digits.
Unfortunately, I can not find a place, the include file, where the max PID is defined for all supported systems.
With regards,
Lutz
p.s.
https://unix.stackexchange.com/questions/16883/what-is-the-maximum-value-of-the-process-id
Comments (4)
-
reporter -
repo owner - changed status to resolved
fix issue
#872: Procmatch PID column show five digits only→ <<cset 16fef3321598>>
-
reporter Hello,
thanks for your help. Without the fix I get truncated PIDs only.monit -B procmatch "/bin/ksh ./loop.*" List of processes matching pattern "/bin/ksh ./loop.*": PID PPID Command * 16... 1 /bin/ksh ./loopiflogserver.sh 16... 1 /bin/ksh ./loopifdca.sh 17... 1 /bin/ksh ./loopim24dca.sh 17... 1 /bin/ksh ./loopdigidca.sh 18... 1 /bin/ksh ./loopposdca.sh Total matches: 5 WARNING: Multiple processes match the pattern. Monit will select the process with the highest uptime, the one highlighted.
With your fix I get the right PIDs.
monit -B procmatch "/bin/ksh ./loop.*" List of processes matching pattern "/bin/ksh ./loop.*": PID PPID Command * 165151 1 /bin/ksh ./loopiflogserver.sh 165202 1 /bin/ksh ./loopifdca.sh 172864 1 /bin/ksh ./loopim24dca.sh 178000 1 /bin/ksh ./loopdigidca.sh 181074 1 /bin/ksh ./loopposdca.sh Total matches: 5 WARNING: Multiple processes match the pattern. Monit will select the process with the highest uptime, the one highlighted.
I do some more tests, but your fix will probably not cause any other problems, I think.
Thanks for your help.
With regards,
Lutz -
reporter Hello everybody,
a package with this fix based on 5.26.0 is available now, see https://bitbucket.org/lutzmad/monit/downloads/monit-5.26.0-suse11vxfs-x64.tar.gzI add the support for large PIDs (monit procmatch with PIDs up to 8 digits) and for the VxFS filesystem statistics also, the sources compiled to support SLES 11 (Linux Kernel 3.0, x86_64 only) systems.
Lutz
- Log in to comment