[debian-lan-devel] [SCM] Debian-LAN development and packaging branch, master, updated. 0.7-21-gc034992

Andreas B. Mundt andi at debian.org
Sun Feb 10 11:36:15 UTC 2013


The following commit has been merged in the master branch:
commit 955adb98b6a05c363fcfb6356025277bf69c0f91
Author: Andreas B. Mundt <andi at debian.org>
Date:   Sun Feb 10 08:59:22 2013 +0100

    Add missing links for munin plugins on first boot.
    
    Not all useful plugins are enabled during FAI installation, as only
    a limited number of packages is available in the FAI nfsroot.
    
    Add the missing plugins on first boot of the installed machine.
    Use hardcoded plugins for diskless machines.
    
    Unite configuration scripts for LOG_CLIENTS in single script.

diff --git a/fai/config/files/etc/rc.local/FAISERVER b/fai/config/files/etc/rc.local/FAISERVER
index 63667b8..6ec021e 100755
--- a/fai/config/files/etc/rc.local/FAISERVER
+++ b/fai/config/files/etc/rc.local/FAISERVER
@@ -126,6 +126,8 @@ EOF
 
 
 #########################
+## Add missing plugins to munin, the line will be commented afterwards:
+munin-node-configure --shell 2>/dev/null | sh && sed -i "s%\(^munin-node-configure\)%\#\1%" $0
 
 ## Setup nfsroot for FAI:
 if [ ! -d $NFSROOT ] ; then
diff --git a/fai/config/scripts/DISKLESS_CLIENT/20-munin.conf b/fai/config/scripts/DISKLESS_CLIENT/20-munin.conf
new file mode 100755
index 0000000..ea7a0bd
--- /dev/null
+++ b/fai/config/scripts/DISKLESS_CLIENT/20-munin.conf
@@ -0,0 +1,45 @@
+#!/bin/bash
+#
+#  munin-node creates links for the mainserver when installing the
+#  chroot for diskless clients.
+#  Remove all links and create only useful ones.
+#  Use 'munin-node-configure  --shell' on a diskless clients to create
+#  the list.
+#
+
+set -e
+
+if [ "$FAI_ACTION" != "dirinstall" ] ; then
+    exit 0
+fi
+
+rm $target/etc/munin/plugins/*
+
+$ROOTCMD ln -s '/usr/share/munin/plugins/cpu' '/etc/munin/plugins/cpu'
+$ROOTCMD ln -s '/usr/share/munin/plugins/df' '/etc/munin/plugins/df'
+$ROOTCMD ln -s '/usr/share/munin/plugins/df_inode' '/etc/munin/plugins/df_inode'
+$ROOTCMD ln -s '/usr/share/munin/plugins/diskstats' '/etc/munin/plugins/diskstats'
+$ROOTCMD ln -s '/usr/share/munin/plugins/entropy' '/etc/munin/plugins/entropy'
+$ROOTCMD ln -s '/usr/share/munin/plugins/forks' '/etc/munin/plugins/forks'
+$ROOTCMD ln -s '/usr/share/munin/plugins/fw_packets' '/etc/munin/plugins/fw_packets'
+$ROOTCMD ln -s '/usr/share/munin/plugins/if_' '/etc/munin/plugins/if_eth0'
+$ROOTCMD ln -s '/usr/share/munin/plugins/if_err_' '/etc/munin/plugins/if_err_eth0'
+$ROOTCMD ln -s '/usr/share/munin/plugins/interrupts' '/etc/munin/plugins/interrupts'
+$ROOTCMD ln -s '/usr/share/munin/plugins/irqstats' '/etc/munin/plugins/irqstats'
+$ROOTCMD ln -s '/usr/share/munin/plugins/load' '/etc/munin/plugins/load'
+$ROOTCMD ln -s '/usr/share/munin/plugins/memory' '/etc/munin/plugins/memory'
+$ROOTCMD ln -s '/usr/share/munin/plugins/nfs4_client' '/etc/munin/plugins/nfs4_client'
+$ROOTCMD ln -s '/usr/share/munin/plugins/nfs_client' '/etc/munin/plugins/nfs_client'
+$ROOTCMD ln -s '/usr/share/munin/plugins/ntp_kernel_err' '/etc/munin/plugins/ntp_kernel_err'
+$ROOTCMD ln -s '/usr/share/munin/plugins/ntp_kernel_pll_freq' '/etc/munin/plugins/ntp_kernel_pll_freq'
+$ROOTCMD ln -s '/usr/share/munin/plugins/ntp_kernel_pll_off' '/etc/munin/plugins/ntp_kernel_pll_off'
+$ROOTCMD ln -s '/usr/share/munin/plugins/ntp_offset' '/etc/munin/plugins/ntp_offset'
+$ROOTCMD ln -s '/usr/share/munin/plugins/open_files' '/etc/munin/plugins/open_files'
+$ROOTCMD ln -s '/usr/share/munin/plugins/open_inodes' '/etc/munin/plugins/open_inodes'
+$ROOTCMD ln -s '/usr/share/munin/plugins/proc_pri' '/etc/munin/plugins/proc_pri'
+$ROOTCMD ln -s '/usr/share/munin/plugins/processes' '/etc/munin/plugins/processes'
+$ROOTCMD ln -s '/usr/share/munin/plugins/swap' '/etc/munin/plugins/swap'
+$ROOTCMD ln -s '/usr/share/munin/plugins/threads' '/etc/munin/plugins/threads'
+$ROOTCMD ln -s '/usr/share/munin/plugins/uptime' '/etc/munin/plugins/uptime'
+$ROOTCMD ln -s '/usr/share/munin/plugins/users' '/etc/munin/plugins/users'
+$ROOTCMD ln -s '/usr/share/munin/plugins/vmstat' '/etc/munin/plugins/vmstat'
diff --git a/fai/config/scripts/FAISERVER/10-config b/fai/config/scripts/FAISERVER/10-config
index 1bcaafe..94e2f05 100755
--- a/fai/config/scripts/FAISERVER/10-config
+++ b/fai/config/scripts/FAISERVER/10-config
@@ -4,11 +4,13 @@ set -e
 
 fcopy -r /etc/fai
 
-## fetch template and insert 'number' of workstations:
-fcopy  /etc/rc.local
-sed -i "s/WS_RANGE/${WS_RANGE}/g" $target/etc/rc.local
-sed -i "s/DL_RANGE/${DL_RANGE}/g" $target/etc/rc.local
+if [ "$FAI_ACTION" == "install" ] || [ "$CONVERT" == "true" ] ; then
+    ## fetch template and insert 'number' of workstations:
+    fcopy  /etc/rc.local
+    sed -i "s/WS_RANGE/${WS_RANGE}/g" $target/etc/rc.local
+    sed -i "s/DL_RANGE/${DL_RANGE}/g" $target/etc/rc.local
 
-if ifclass DISKLESS_SERVER ; then
-    sed -i "s%\(^.*\#\#DISKLESS_SERVER\#\#\)%\#\1%"  $target/etc/rc.local
+    if ifclass DISKLESS_SERVER ; then
+	sed -i "s%\(^.*\#\#DISKLESS_SERVER\#\#\)%\#\1%"  $target/etc/rc.local
+    fi
 fi
diff --git a/fai/config/scripts/LOG_CLIENT/10-misc.conf b/fai/config/scripts/LOG_CLIENT/10-misc.conf
new file mode 100755
index 0000000..65c5379
--- /dev/null
+++ b/fai/config/scripts/LOG_CLIENT/10-misc.conf
@@ -0,0 +1,30 @@
+#!/bin/bash
+#
+#  Configure syslog, munin and icinga.
+#
+
+set -e
+
+fcopy -r /etc/rsyslog.d/
+fcopy -r /etc/nagios/
+
+
+## allow access from host 'syslog':
+IP=$(host syslog | tail -n 1 | awk '{print $NF}' | egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')
+
+if [ -n $IP ] ; then
+    ainsl -a /etc/nagios/nrpe.d/debian-lan.cfg "allowed_hosts=${IP}"
+    IP=${IP//\./\\\.}
+    ainsl -Q /etc/munin/munin-node.conf "allow ^${IP}$" "allow ^${IP}$"
+fi
+
+## reconfigure munin-node on first boot (excludes diskless machines: 'dirinstall'):
+if [ "$FAI_ACTION" == "install" ] ; then
+    FILE="$target/etc/rc.local"
+    sed -i "s%\(^exit 0\)%\#\1%" $FILE
+    cat >> $FILE <<EOF
+
+## Add missing plugins to munin, the line will be commented afterwards:
+munin-node-configure --shell 2>/dev/null | sh && sed -i -e "s%\(^munin-node-configure\)%\#\1%" -e "s%\#\(exit 0\)%\1%" \$0
+EOF
+fi
diff --git a/fai/config/scripts/LOG_CLIENT/10-rsyslog-nrpe.conf b/fai/config/scripts/LOG_CLIENT/10-rsyslog-nrpe.conf
deleted file mode 100755
index ae6419e..0000000
--- a/fai/config/scripts/LOG_CLIENT/10-rsyslog-nrpe.conf
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-fcopy -r /etc/rsyslog.d/
-fcopy -r /etc/nagios/
-
diff --git a/fai/config/scripts/LOG_CLIENT/20-access-node.conf b/fai/config/scripts/LOG_CLIENT/20-access-node.conf
deleted file mode 100755
index b253c45..0000000
--- a/fai/config/scripts/LOG_CLIENT/20-access-node.conf
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-#
-#  allow the host syslog to access the client node
-#
-
-set -e
-
-IP=$(host syslog | tail -n 1 | awk '{print $NF}' | egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}')
-
-if [ -n $IP ] ; then
-    ainsl -a /etc/nagios/nrpe.d/debian-lan.cfg "allowed_hosts=${IP}"
-    IP=${IP//\./\\\.}
-    ainsl -Q /etc/munin/munin-node.conf "allow ^${IP}$" "allow ^${IP}$"
-fi

-- 
Debian-LAN development and packaging



More information about the debian-lan-devel mailing list