libs check turns yellow if no kernel image exists

Bug #1534220 reported by Andreas Oberritter
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
hobbit-plugins (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

If there's no kernel image installed, e.g. in an LXC environment, then the following output gets generated. This didn't happen in 14.04 LTS.

Thu Jan 14 16:00:37 2016 - libs NOT ok

yellow Warning: Use of uninitialized value $newest_kernel_image in pattern match (m//) at /usr/lib/xymon/client/ext/libs line 66.
yellow Warning: Use of uninitialized value $newest_kernel_image in concatenation (.) or string at /usr/lib/xymon/client/ext/libs line 69.
yellow Warning: Use of uninitialized value $kernel_image_release in concatenation (.) or string at /usr/lib/xymon/client/ext/libs line 74.
yellow Warning: Use of uninitialized value $newest_kernel_image in -r at /usr/lib/xymon/client/ext/libs line 86.
yellow Warning: Use of uninitialized value $newest_kernel_image in concatenation (.) or string at /usr/lib/xymon/client/ext/libs line 87.
yellow Kernel image unreadable. Can't check kernel version!
See comment #3 on https://bugs.launchpad.net/bugs/759725 for details and a permanent workaround.

In a container environment, testing the kernel version doesn't make sense anyway, as the host kernel will always be in use. Maybe you could disable the test if you detect a container? There are many ways to do this, e.g.:

1.) Manually

Detect Libvirt-LXC:
# grep -z '^LIBVIRT_LXC_NAME=' /proc/1/environ
LIBVIRT_LXC_NAME=xyz

Detect LXC:
# grep -z '^container=' /proc/1/environ
container=lxc

Detect Linux-Vserver (VxID > 0):
# grep -E '^VxID:\s+[1-9]' /proc/self/status
VxID: 40010

(See /etc/init/container-detect.conf on 14.04 for more examples)

2.) With upstart (14.04 LTS)

# cat /run/container_type
lxc-libvirt

3.) With systemd (16.04 Development)

# systemd-detect-virt -c
lxc-libvirt

---

# ls -la /boot/
total 8
drwxr-xr-x 2 root root 4096 Apr 11 2014 .
drwxr-xr-x 22 root root 4096 Jan 7 23:15 ..

# lsb_release -rd
Description: Ubuntu Xenial Xerus (development branch)
Release: 16.04

# apt-cache policy hobbit-plugins
hobbit-plugins:
  Installiert: 20151005
  Installationskandidat: 20151005
  Versionstabelle:
 *** 20151005 500
        500 http://de.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
        100 /var/lib/dpkg/status

Revision history for this message
Axel Beckert (xtaran) wrote :
Changed in hobbit-plugins (Ubuntu):
status: New → In Progress
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package hobbit-plugins - 20160122

---------------
hobbit-plugins (20160122) unstable; urgency=low

  [ Christoph Berg ]
  * Restructure source to "make install" easier.
  * misc, xynagios: Rewrite to use IPC::Run.
  * Install xynagios to /usr/bin (but provide symlink from old location).
  * xynagios: Add --test option and options to configure RRD trends data.
  * Add t/xynagios.t.

  [ Axel Beckert ]
  * temp: Fix uninitialized values if /sys/devices/platform/*/temp*_input
    exists, has read permissions, but is still not readable.
  * Fix the remaining occurrences of "bb-hosts" in the documentation.
  * libs: Don't warn if no kernel is found, e.g. in containers. (LP:
    #1534220)
  * Remove obsolete "GPL-2" license paragraph in debian/copyright. Thanks
    Lintian!
  * Bump debhelper compatibility to 9 as recommended.
  * mq:
    + Recognize when GMail/Google is blocking the monitored server.
    + Ignore possible RBL issues from ocmail<somenumber>.in.
    + Don't count greylisting, local problems on the remote server, too
      much load on the remote server or shutting down servers as RBL
      issues.
  * Get test suite working again by adding a symlink lib →
    src/usr/share/perl5. Also replace "perl -Iperl" in individual tests by
    using "prove -l". That way (using "lib" instead of "perl" as source
    code path name) the test suite is also closer to what's standard in
    the Perl community.

  [ Mathias Merscher ]
  * Add /etc/xymon/plugins.yaml for plugin configuration.
  * Make entropy and ntpq tests configurable, add ntpq graph.
  * Add netstats test.

 -- Axel Beckert <email address hidden> Fri, 22 Jan 2016 15:13:58 +0100

Changed in hobbit-plugins (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.