Make the check work with Ubuntu's kernel names (Alexander Reichle-Schmehl)
authorPeter Palfrader <peter@palfrader.org>
Mon, 24 Jan 2011 15:27:26 +0000 (16:27 +0100)
committerPeter Palfrader <peter@palfrader.org>
Mon, 24 Jan 2011 15:27:26 +0000 (16:27 +0100)
dsa-nagios-checks/checks/dsa-check-running-kernel
dsa-nagios-checks/debian/changelog

index 452c8c1..cb5168b 100755 (executable)
@@ -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
index e3ce9dd..c0c55f9 100644 (file)
@@ -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 <weasel@debian.org>  Wed, 08 Dec 2010 15:39:33 +0100
+ -- Peter Palfrader <weasel@debian.org>  Mon, 24 Jan 2011 16:26:44 +0100
 
 dsa-nagios-checks (87) unstable; urgency=low