From a9644bdfda5095fd3dd0db80d69396280eb00237 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Mon, 24 Jan 2011 16:27:26 +0100 Subject: [PATCH] Make the check work with Ubuntu's kernel names (Alexander Reichle-Schmehl) --- dsa-nagios-checks/checks/dsa-check-running-kernel | 7 +++++++ dsa-nagios-checks/debian/changelog | 9 ++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/dsa-nagios-checks/checks/dsa-check-running-kernel b/dsa-nagios-checks/checks/dsa-check-running-kernel index 452c8c1..cb5168b 100755 --- a/dsa-nagios-checks/checks/dsa-check-running-kernel +++ b/dsa-nagios-checks/checks/dsa-check-running-kernel @@ -6,6 +6,7 @@ # Copyright 2008,2009 Peter Palfrader # Copyright 2009 Stephen Gran # Copyright 2010 Uli Martens +# Copyright 2011 Alexander Reichle-Schmehl # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -165,6 +166,12 @@ for on_disk in \ fi if [ "${on_disk/vmlinu}" != "$on_disk" ]; then on_disk_version="`get_image_linux "$on_disk" | strings | grep 'Linux version' | head -n1`" + if [ -x /usr/bin/lsb_release ] ; then + vendor=$(lsb_release -i -s) + if [ -n "$vendor" ] && [ "xDebian" != "x$vendor" ] ; then + on_disk_version=$( echo $on_disk_version|sed -e "s/ ($vendor [[:alnum:]\.-]\+ [[:alnum:]\.]\+)//") + fi + fi [ -z "$on_disk_version" ] || break on_disk_version="`cat "$on_disk" | strings | grep 'Linux version' | head -n1`" [ -z "$on_disk_version" ] || break diff --git a/dsa-nagios-checks/debian/changelog b/dsa-nagios-checks/debian/changelog index e3ce9dd..c0c55f9 100644 --- a/dsa-nagios-checks/debian/changelog +++ b/dsa-nagios-checks/debian/changelog @@ -8,8 +8,11 @@ dsa-nagios-checks (8x) xnstable; urgency=low - ignore the line for unassigned disks (patch by Emmanuel Lacour). * Add dsa-check-ups. * Add dsa-check-hpacucli-enclosure. - * dsa-check-running-kernel: check if 'strings' is installed and - complain nicely if it isn't instead of falling over. [Uli Martens] + * dsa-check-running-kernel: + - check if 'strings' is installed and complain nicely if it isn't instead + of falling over. [Uli Martens] + - Make the check work with Ubuntu's kernel names (Alexander + Reichle-Schmehl). * dsa-check-afs-*: add checks from Russ Allbery for monitoring our AFS * Add dsa-check-port-closed. * dsa-check-hpasm: Incorporate patch from Jan Wagner to ignore "N/A" DIMM @@ -19,7 +22,7 @@ dsa-nagios-checks (8x) xnstable; urgency=low * dsa-check-udldap-freshness: Also check age of /var/lib/misc/passwd.db in addition to /var/lib/misc/thishost/passwd.tdb. - -- Peter Palfrader Wed, 08 Dec 2010 15:39:33 +0100 + -- Peter Palfrader Mon, 24 Jan 2011 16:26:44 +0100 dsa-nagios-checks (87) unstable; urgency=low -- 2.20.1