nagios-plugins: utils.pm contains empty $PATH_TO_MAILQ
In alpine 3.18 and edge, the package nagios-plugins provides the file /usr/lib/nagios/plugins/utils.pm, which unfortunately lacks the correct path for the mailq binary. Hence, the check returns the following error message:
81f5cedcdd71:/# /usr/lib/nagios/plugins/check_mailq -w 5 -c 10
ERROR: is not executable by (uid 0:gid(0 0 1 2 3 4 6 10 11 20 26 27)) and sudo is not set in utils.pm
This error occurs in 3.18 as well as in edge.
This is how you can confirm this as follows:
root@marco-laptop:~# docker run --rm -ti alpine:latest
/ # apk upgrade -Ua && apk add postfix nagios-plugins nagios-plugins-mailq
...
/ # /usr/sbin/postfix start
postfix/postfix-script: starting the Postfix mail system
/ # mailq
Mail queue is empty
/ # /usr/lib/nagios/plugins/check_mailq -w 5 -c 10
ERROR: is not executable by (uid 0:gid(0 0 1 2 3 4 6 10 11 20 26 27)) and sudo is not set in utils.pm
A temporary solution is to edit /usr/lib/nagios/plugins/utils.pm and manually set the correct $PATH_TO_MAILQ.