[D-community-commits] r354 - in trunk/fai-config-dir: package_config scripts/DEFAULT

holger at alioth.debian.org holger at alioth.debian.org
Mon Oct 27 20:16:33 UTC 2008


Author: holger
Date: 2008-10-27 20:16:32 +0000 (Mon, 27 Oct 2008)
New Revision: 354

Modified:
   trunk/fai-config-dir/package_config/DEFAULT
   trunk/fai-config-dir/scripts/DEFAULT/31-munin-node
Log:
monitor hw with lm-sensors and munin

Modified: trunk/fai-config-dir/package_config/DEFAULT
===================================================================
--- trunk/fai-config-dir/package_config/DEFAULT	2008-10-27 09:18:10 UTC (rev 353)
+++ trunk/fai-config-dir/package_config/DEFAULT	2008-10-27 20:16:32 UTC (rev 354)
@@ -7,6 +7,10 @@
 git-core git-doc git-svn 
 fail2ban
 
+# hw related if we ever choose to split this from DEFAULT
+PACKAGES aptitude-r
+lm-sensors
+
 PACKAGES remove
 portmap nfs-common
 

Modified: trunk/fai-config-dir/scripts/DEFAULT/31-munin-node
===================================================================
--- trunk/fai-config-dir/scripts/DEFAULT/31-munin-node	2008-10-27 09:18:10 UTC (rev 353)
+++ trunk/fai-config-dir/scripts/DEFAULT/31-munin-node	2008-10-27 20:16:32 UTC (rev 354)
@@ -15,7 +15,22 @@
   $ROOTCMD ln -s /usr/share/munin/plugins/$i /etc/munin/plugins/$i
 done
 
+#
+# if sensors is configured (has to be done manually by running sensors-detect)
+# enable the munin plugins
+#
+if $(sensors >/dev/null 2>&1) ; then
+ # only enable plugins if sensors provide data
+ export SENSORTEMP=$(mktemp)
+ sensors 2> /dev/null > $SENSORTEMP
+ grep -q -i fan $SENSORTEMP                  && ln -s /usr/share/munin/plugins/sensors_ /etc/munin/plugins/sensors_fan
+ grep -q -i temp $SENSORTEMP                 && ln -s /usr/share/munin/plugins/sensors_ /etc/munin/plugins/sensors_temp
+ grep V $SENSORTEMP | grep max | grep -q min && ln -s /usr/share/munin/plugins/sensors_ /etc/munin/plugins/sensors_volt
+ rm $SENSORTEMP
+else
+ echo WARNING: sensors not configured properly. please run sensors-detect and load the modules.
+fi
+
 # restart munin-node
 $ROOTCMD /etc/init.d/munin-node restart
 
-




More information about the D-community-commits mailing list