Xymon Mailing List Archive search

Can't check kernel version on arm64 systems

list Adam Goryachev
Thu, 28 Jul 2022 21:45:26 +1000
Message-Id: <user-1b21f82d89d0@xymon.invalid>

On 28/7/2022 19:46, Jaap Winius via Xymon wrote:
Hi folks,

My systems mostly run the Debian 11 xymon-client and hobbit-plugins packages for amd64 and armhf. However, I've now got a few arm64 systems (for the Odroid N2+) and have run into a problem. After installing a few missing dependencies for this architecture (libyaml-tiny-perl, libfile-slurp-perl and lsof), the libs check now says:

Couldn't check for string '4.9.277-arm64' in /boot/vmlinuz-4.9.277-arm64. Can't check kernel version!

Seeing as there's nothing wrong with my systems, how can I get Xymon to ignore this issue, or better yet, run the kernel version properly?

Thanks,

Jaap

In my case, looks like I made two small changes:

 ???? my $kernel_image_release = $1;

 ???? my $kernel_image_read_command = "strings '$newest_kernel_image'";
-??? if (`dpkg --print-architecture` =~ /sparc/) {
+??? if (-x '/usr/bin/dpkg' and `dpkg --print-architecture` =~ /(sparc|arm64)/) {
 ??????? $kernel_image_read_command = "zcat -f --stdout '$newest_kernel_image' | strings";
 ???? }

-??????????? if ($kernel_image_version =~ /^(Linux version )?\Q$running_kernel_release\E \(.*\) \Q$running_kernel_version\E$/) {
+??????????? if ($kernel_image_version =~ /^(Linux version )?\Q$running_kernel_release\E \(.*\) \Q$running_kernel_version\E/) {


In addition, you will need to create these two files:

$ cat /etc/kernel/postinst.d/statoverride
#!/bin/sh
version="$1"
# passing the kernel version is required
[ -z "${version}" ] && exit 0
echo "Checking /boot/vmlinuz-${version}"
dpkg-statoverride --list /boot/vmlinuz-${version}
if `dpkg-statoverride --list /boot/vmlinuz-${version} > /dev/null`
then
 ?? ?echo "Override found - skipping"
 ?? ?exit 0
else
 ?? ?dpkg-statoverride --update --add root adm 0640 /boot/vmlinuz-${version}
fi
exit 0


$ cat /etc/kernel/postrm.d/statoverride
#!/bin/bash
version="$1"
# passing the kernel version is required
[ -z "${version}" ] && exit 0
echo "Checking /boot/vmlinuz-${version}"
dpkg-statoverride --list /boot/vmlinuz-${version}
if `dpkg-statoverride --list /boot/vmlinuz-${version} > /dev/null`
then
 ?? ?echo "No override found - skipping"
 ?? ?exit 0
else
 ?? ?dpkg-statoverride --remove /boot/vmlinuz-${version}
fi
exit 0

Finally, since these will only run during kernel package installation/removal, you should run the postinst script manually for currently installed kernels.

I do also modify the default permissions for xymon to add it to the adm group, this provides access to /var/log files as well as the above kernel images which are group adm and permission 640, so you either need to do that as well or adjust the permissions assigned in the postinst so that xymon will have read access.

Hope that helps