Skip to content

[patch] check_deb_kernel_version gets confused by needrestart #1

@tpo

Description

@tpo
# /usr/lib/nagios/plugins/check_deb_kernel_version 
CRITICAL - Reboot required. Running kernel 4.9.0-6-amd64 is too old, newest kernel on disk is needrestart

let's see where that comes from:

# cat /usr/lib/nagios/plugins/check_deb_kernel_version
[...]
LATEST_KERNEL=$(dpkg-query --search vmlinuz-* | sort -V | tail -1 | cut -d " " -f1 | sed 's/://g' | sed 's/linux-image-//g')
[...]

let's try that query manually:

# dpkg-query --search vmlinuz-* 
linux-image-4.9.0-3-amd64: /boot/vmlinuz-4.9.0-3-amd64
needrestart: /usr/lib/needrestart/vmlinuz-get-version
linux-image-4.9.0-6-amd64: /boot/vmlinuz-4.9.0-6-amd64

oh. So let's try to fix that query:

# dpkg-query --search /boot/vmlinuz-* 
linux-image-4.9.0-3-amd64: /boot/vmlinuz-4.9.0-3-amd64
linux-image-4.9.0-6-amd64: /boot/vmlinuz-4.9.0-6-amd64

That's better :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions