[Pkg-nagios-devel] Bug#884328: nagios-plugins-contrib: check_running_kernel should use version sort

Erik Auerswald auerswald at fg-networking.de
Tue Oct 2 15:54:56 BST 2018


Hi,

I have encountered this problem recently as well. The check compares
the running kernel version with the wrong installed version.

It seems to me the problem is created by not using version sort[0]
with the result that in the original bug reporter's case 3.2.0-4-amd64
is seen as bigger than 3.16.0-4-amd64, or that 4.9.0-8-amd64 is seen as
more recent than 4.18.6-1~bpo9+1 in my case.

In my case the output of the check is as follows:

# /usr/lib/nagios/plugins/check_running_kernel
WARNING: Running kernel does not match on-disk kernel image: [Linux version 4.18.0-0.bpo.1-amd64 (debian-kernel at lists.debian.org) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)) #1 SMP Debian 4.18.6-1~bpo9+1 (2018-09-13) != Linux version 4.9.0-8-amd64 (debian-kernel at lists.debian.org) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1) ) #1 SMP Debian 4.9.110-3+deb9u5 (2018-09-30)]

Simply using version sort (adding option -V to sort) solves the problem:

# ./check_running_kernel.fixed_version_sorting 
OK: Running kernel matches on disk image: [Linux version 4.18.0-0.bpo.1-amd64 (debian-kernel at lists.debian.org) (gcc version 6.3.0 20170516 (Debian 6.3.0-18+deb9u1)) #1 SMP Debian 4.18.6-1~bpo9+1 (2018-09-13)]

Please see the attached patch.

Please consider applying the attached patch or a similar fix to the
Debian package.

Thanks,
Erik

[0] https://www.gnu.org/software/coreutils/manual/html_node/Details-about-version-sort.html
-- 
Dipl.-Inform. Erik Auerswald         http://www.fg-networking.de/
auerswald at fg-networking.de T:+49-631-4149988-0 M:+49-176-64228513

Gesellschaft für Fundamental Generic Networking mbH
Geschäftsführung: Volker Bauer, Jörg Mayer
Gerichtsstand: Amtsgericht Kaiserslautern - HRB: 3630
-------------- next part --------------
A non-text attachment was scrubbed...
Name: nagios-plugins-contrib--check_running_kernel--use_version_sort.patch
Type: text/x-diff
Size: 1577 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-nagios-devel/attachments/20181002/0e353f1d/attachment.patch>


More information about the Pkg-nagios-devel mailing list