[project @ peter@palfrader.org-20080505174137-50lwpqcqpvj61871]
authorPeter Palfrader <peter@palfrader.org>
Mon, 5 May 2008 17:41:37 +0000 (17:41 +0000)
committerPeter Palfrader <peter@palfrader.org>
Mon, 5 May 2008 17:41:37 +0000 (17:41 +0000)
dsa-check-running-kernel: also check /boot/vmlinux-`uname -r`
Depend on binutils for string(1).

dsa-nagios-nrpe-config/debian/changelog
dsa-nagios-nrpe-config/debian/control
dsa-nagios-nrpe-config/dsa-check-running-kernel
nagios-master.cfg

index 696623a..fe8b291 100644 (file)
@@ -1,3 +1,10 @@
+dsa-nagios-nrpe-config (37) unstable; urgency=low
+
+  * dsa-check-running-kernel: also check /boot/vmlinux-`uname -r`
+  * Depend on binutils for string(1).
+
+ -- Peter Palfrader <weasel@debian.org>  Mon,  5 May 2008 17:41:13 +0000
+
 dsa-nagios-nrpe-config (36) unstable; urgency=low
 
   * Add dsa-check-running-kernel
 dsa-nagios-nrpe-config (36) unstable; urgency=low
 
   * Add dsa-check-running-kernel
index 801015d..e363155 100644 (file)
@@ -7,7 +7,7 @@ Standards-Version: 3.7.2
 
 Package: dsa-nagios-nrpe-config
 Architecture: all
 
 Package: dsa-nagios-nrpe-config
 Architecture: all
-Depends: nagios-nrpe-server, nagios-plugins-basic, ${misc:Depends}
+Depends: nagios-nrpe-server, nagios-plugins-basic, ${misc:Depends}, binutils
 Description: debian.org nagios-nrpe-server configuration
  This package provides the debian.org configuration for the
  nagios-nrpe-server, automatically created from the debian.org
 Description: debian.org nagios-nrpe-server configuration
  This package provides the debian.org configuration for the
  nagios-nrpe-server, automatically created from the debian.org
index 7d2cb3a..6ec28c9 100755 (executable)
@@ -66,15 +66,20 @@ get_image() {
        echo "ERROR: Unable to extract kernel image." 2>&1
        exit 1
 }
        echo "ERROR: Unable to extract kernel image." 2>&1
        exit 1
 }
+on_disk_compressed="/boot/vmlinuz-`uname -r`"
+on_disk_uncompressed="/boot/vmlinux-`uname -r`"
 
 
-on_disk="/boot/vmlinuz-`uname -r`"
-
-if ! [ -e "$on_disk" ] ; then
-       echo "WARNING: $on_disk does not exist - I have no idea which kernel I am running"
-       exit $WARN
+if [ -e "$on_disk_compressed" ]; then
+       on_disk="$on_disk_compressed"
+       on_disk_version="`get_image "$on_disk" | strings | grep 'Linux version' | head -n1`"
+elif [ -e "$on_disk_uncompressed" ]; then
+       on_disk="$on_disk_uncompressed"
+       on_disk_version="`cat "$on_disk" | strings | grep 'Linux version' | head -n1`"
+else
+       echo "WARNING: Neither $on_disk_uncompressed nor $on_disk_compressed do exist - I have no idea which kernel I am running"
+       exit $WARNING
 fi
 
 fi
 
-on_disk_version="`get_image $on_disk | strings | grep 'Linux version' | head -n1`"
 if [ -z "$on_disk_version" ] ; then
        echo "UNKNOWN: Failed to get a version string from image $on_disk"
        exit $UNKNOWN
 if [ -z "$on_disk_version" ] ; then
        echo "UNKNOWN: Failed to get a version string from image $on_disk"
        exit $UNKNOWN
index 8459a72..9e2440d 100644 (file)
@@ -505,6 +505,8 @@ servicegroups:
     alias: buildd checks
   raid:
     alias: raid checks
     alias: buildd checks
   raid:
     alias: raid checks
+  kernel:
+    alias: kernel checks
 
 #############################
 # services
 
 #############################
 # services
@@ -631,6 +633,15 @@ services:
     max_check_attempts: 2
     retry_check_interval: 5
 
     max_check_attempts: 2
     retry_check_interval: 5
 
+ ####
+  -
+    name: running kernel
+    servicegroups: kernel
+    nrpe: "/usr/lib/nagios/plugins/dsa-check-running-kernel"
+    hostgroups: computers
+    normal_check_interval: 180
+    retry_check_interval: 5
+
  ####
   -
     name: users
  ####
   -
     name: users