[Pkg-nagios-devel] Bug#905318: monitoring-plugins-common: $PATH_TO_SUDO is not set (required by check_mailq -s)

Adam Bolte abolte at systemsaviour.com
Fri Aug 3 04:52:59 BST 2018

Package: monitoring-plugins-common
Version: 2.2-3
Severity: normal

Dear Maintainer,

*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?

I have a postfix installation where main.cf is configured like so:

-rw-r----- 1 root root 2013 Aug  3 11:41 /etc/postfix/main.cf

This breaks mailq if executed without sudo, so I have icinga2 call
check_mail (from the monitoring-plugins-standard package) with
-s. This doesn't work since the check_mail script is actually unable
to call the sudo command.

   * What exactly did you do (or not do) that was effective (or

This fixes the issue:

$ diff /usr/lib/nagios/plugins/utils.pm{.orig,}
< $PATH_TO_SUDO    = "";
> $PATH_TO_SUDO    = "/usr/bin/sudo";

Apparently the build system is supposed to take care of this

   * What was the outcome of this action?

$ /usr/lib/nagios/plugins/check_mailq -s -w 4 -c 8 -M postfix -v
mailq: fatal: open /etc/postfix/main.cf: Permission denied
CRITICAL: Error code 75 returned from /usr/bin/mailq

   * What outcome did you expect instead?

$ /usr/lib/nagios/plugins/check_mailq -s -w 4 -c 8 -M postfix -v
OK: postfix mailq reports queue is empty|unsent=0;4;8;0

Hopefully it's a simple fix. Thanks for taking a look.


*** End of the template - remove these template lines ***

-- System Information:
Debian Release: 9.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable'), (50, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 4.16.0-0.bpo.2-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_AU.utf8, LC_CTYPE=en_AU.utf8 (charmap=UTF-8), LANGUAGE=en_AU.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages monitoring-plugins-common depends on:
ii  libc6  2.24-11+deb9u3
ii  ucf    3.0036

monitoring-plugins-common recommends no packages.

Versions of packages monitoring-plugins-common suggests:
pn  icinga | icinga2  <none>

More information about the Pkg-nagios-devel mailing list