[Pkg-nagios-devel] Bug#862669: check_whois is confused by multiple entries in whois output

Iustin Pop iustin at debian.org
Mon May 15 15:40:34 UTC 2017

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


The whois output on my domain looks like this:

# registry expiry date: 2019-12-06t22:49:48z
# registrar registration expiration date:

This means that the script first assign the valid date to expiry, then
overwrites it with the empty field. I think it would be a much better
idea to only overwrite $expires with the extracted value if non-empty,
i.e. changing code of the type:

                } elsif (/expires:\s+([-\w\s]+)/) {
                        $expires = $1;

                } elsif (/expires:\s+([-\w\s]+)/) {
                        $expires = $1 if $1;

I forgot all perl I know, so I don't know if this is idiomatic or not,
but something along these line for all the 'if' branches in the output
parsing would be useful. Even better would be to only accept valid
dates, and not all non-empty text.

(debsums errors because I fixed this issue in my installation)


-- System Information:
Debian Release: 9.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.18-teal0 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=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.1
ii  binutils                                           2.28-2
pn  freeipmi-tools                                     <none>
ii  libc6                                              2.24-9
ii  libdata-validate-domain-perl                       0.10-1
ii  libdata-validate-ip-perl                           0.27-1
ii  libdate-manip-perl                                 6.57-1
pn  libdbd-mysql-perl                                  <none>
ii  libio-socket-ssl-perl                              2.044-1
ii  libipc-run-perl                                    0.94-1
ii  liblocale-gettext-perl                             1.07-3+b1
pn  liblwp-useragent-determined-perl                   <none>
ii  libmail-imapclient-perl                            3.38-1
pn  libmemcached11                                     <none>
pn  libmemcachedutil2                                  <none>
pn  libmonitoring-plugin-perl | libnagios-plugin-perl  <none>
ii  libnet-cups-perl                                   0.63-1
ii  libnet-dns-perl                                    1.07-1
pn  libnet-dns-sec-perl                                <none>
ii  libnet-smtp-ssl-perl                               1.04-1
ii  libnet-smtp-tls-perl                               0.12-3
pn  libnet-smtpauth-perl                               <none>
ii  libnet-snmp-perl                                   6.0.1-2
ii  libnet-ssleay-perl                                 1.80-1
pn  libreadonly-perl                                   <none>
pn  libredis-perl                                      <none>
ii  libtimedate-perl                                   2.3000-2
pn  libvarnishapi1                                     <none>
pn  libwebinject-perl                                  <none>
ii  libxml-simple-perl                                 2.22-1
ii  libyaml-syck-perl                                  1.29-1+b2
ii  lsof                                               4.89+dfsg-0.1
pn  nagios-plugins-basic                               <none>
ii  openssl                                            1.1.0e-1
ii  perl-base [libsocket-perl]                         5.24.1-2
pn  perl:any                                           <none>
ii  python                                             2.7.13-2
pn  python-pymongo                                     <none>
ii  ruby                                               1:2.3.3
ii  snmp                                               5.7.3+dfsg-1.7
ii  whois                                              5.2.15

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

-- no debconf information

-- debsums errors found:
debsums: changed file /usr/lib/nagios/plugins/check_whois (from nagios-plugins-contrib package)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-nagios-devel/attachments/20170515/1ab74e0c/attachment.sig>

More information about the Pkg-nagios-devel mailing list