Open dwhile opened 6 years ago
Confirmed. exec
only adds the values to the $output
variable and does not overwrite it.
Also for postfix only the master process is counted. Various processes for the queues aren't detected like smtpd
, smtp
, cleanup
etc. because they don't have postfix in their name.
Also there can be other processes that do get parameters containing postfix that will be counted as well.
Better would probably be to filter for the mta user, which seems to be at least a bit more accurate for postfix:
# ps -U postfix -u postfix | grep -v MailScanner | grep -v "MailWatch SQL"
PID TTY TIME CMD
2039 ? 00:00:00 qmgr
2043 ? 00:00:01 tlsmgr
58085 ? 00:00:00 pickup
58369 ? 00:00:00 anvil
58371 ? 00:00:00 spawn
58692 ? 00:00:00 smtpd
58694 ? 00:00:00 trivial-rewrite
58695 ? 00:00:00 cleanup
58763 ? 00:00:00 smtp
58962 ? 00:00:00 smtp
58993 ? 00:00:00 bounce
Issue summary
The process count for the MTA is wrong on the home page. The process count for the MTA is actually the process count for the MTA PLUS MailScanner.
This is caused by the use of the exec function. By using the optional output argument the manual states that if the output array contains any data then the output of the exec command is appended.
This can be fixed by using an unset($output) between the exec calls.
Steps to reproduce
Expected result
The count of processes should reflect the number of MTA processes
Actual result
The count of MTA processes is equal to the MTA processes PLUS MailSCanner processes
Installation
Mailwatch V1.2.7 upgraded via zip from older version.
Server configuration
Client configuration