[Pkg-nagios-devel] Bug#923808: nagios-plugins-contrib: check_printer always fails with supplied printer.cfg

Ian Chard ian at chard.org
Tue Mar 5 15:34:43 GMT 2019

Package: nagios-plugins-contrib
Version: 21.20170222
Severity: normal
Tags: patch

The supplied /etc/nagios-plugins/config/printer.cfg can never work
because the three permitted arguments are quoted.  check_printer
requires that -w <threshold> and -c <threshold> both be specified, but
trying to do something like

  check_command  check_printer!-w 5!-c 10

fails because printer.cfg quotes the arguments, so check_printer sees
argv[1] as "-w 5".

Patching printer.cfg to look like users.cfg solves the problem:

--- /etc/nagios-plugins/config/printer.cfg      2017-02-22 13:32:22.000000000 +0000
+++ printer.cfg 2019-03-05 15:21:20.314526277 +0000
@@ -1,5 +1,5 @@
 define command{
         command_name    check_printer
-        command_line    /usr/lib/nagios/plugins/check_printer -h '$HOSTADDRESS$' '$ARG1$' '$ARG2$' '$ARG3$'
+        command_line    /usr/lib/nagios/plugins/check_printer -h '$HOSTADDRESS$' -w '$ARG1$' -c '$ARG2$'

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

Kernel: Linux 4.9.0-8-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

nagios-plugins-contrib depends on no packages.

Versions of packages nagios-plugins-contrib recommends:
ii  bind9-host                        1:9.10.3.dfsg.P4-12.3+deb9u4
ii  binutils                          2.28-5
ii  freeipmi-tools                    1.4.11-1.1+b1
ii  libc6                             2.24-11+deb9u4
ii  libdata-validate-domain-perl      0.10-1
ii  libdata-validate-ip-perl          0.27-1
ii  libdate-manip-perl                6.57-1
ii  libdbd-mysql-perl                 4.041-2
ii  libio-socket-ssl-perl             2.044-1
ii  libipc-run-perl                   0.94-1+deb9u1
ii  liblocale-gettext-perl            1.07-3+b1
ii  liblwp-useragent-determined-perl  1.07-1
ii  libmail-imapclient-perl           3.38-1
ii  libmemcached11                    1.0.18-4.1
ii  libmemcachedutil2                 1.0.18-4.1
ii  libmonitoring-plugin-perl         0.39-1
ii  libnet-cups-perl                  0.63-1
ii  libnet-dns-perl                   1.07-1
ii  libnet-dns-sec-perl               1.03-1
ii  libnet-smtp-ssl-perl              1.04-1
ii  libnet-smtp-tls-perl              0.12-3
ii  libnet-smtpauth-perl              0.08-4
ii  libnet-snmp-perl                  6.0.1-2
ii  libnet-ssleay-perl                1.80-1
ii  libreadonly-perl                  2.050-1
ii  libredis-perl                     2:1.9910-1
ii  libtimedate-perl                  2.3000-2
ii  libvarnishapi1                    5.0.0-7+deb9u2
ii  libwebinject-perl                 1.92-1
ii  libxml-simple-perl                2.22-1
ii  libyaml-syck-perl                 1.29-1+b2
ii  lsof                              4.89+dfsg-0.1
ii  nagios-plugins-basic              2.2-3
ii  openssl                           1.1.0j-1~deb9u1
ii  perl                              5.24.1-3+deb9u5
ii  perl-base [libsocket-perl]        5.24.1-3+deb9u5
ii  python                            2.7.13-2
ii  python-pymongo                    3.4.0-1
ii  ruby                              1:2.3.3
ii  snmp                              5.7.3+dfsg-1.7+deb9u1
ii  whois                             5.2.17~deb9u1

Versions of packages nagios-plugins-contrib suggests:
pn  backuppc                   <none>
pn  cciss-vol-status           <none>
pn  expect                     <none>
pn  libsys-virt-perl           <none>
pn  moreutils                  <none>
pn  mpt-status                 <none>
pn  nagios-plugin-check-multi  <none>
pn  percona-toolkit            <none>
pn  perl-doc                   <none>
ii  python2.7                  2.7.13-2+deb9u3
pn  smstools                   <none>

-- no debconf information

More information about the Pkg-nagios-devel mailing list