[debian-lan-devel] [SCM] Debian-LAN development and packaging branch, squeeze, updated. 0.6-24-g390a900
Andreas B. Mundt
andi at debian.org
Thu Sep 20 12:17:59 UTC 2012
The following commit has been merged in the squeeze branch:
commit 390a9003696c2440f031a2b6594a56025bbd444a
Author: Andreas B. Mundt <andi at debian.org>
Date: Thu Sep 20 14:08:03 2012 +0200
Fix munin node: Dynamically find IP address of munin gatherer host.
diff --git a/fai/config/scripts/LOG_CLIENT/20-munin-node.conf b/fai/config/scripts/LOG_CLIENT/20-munin-node.conf
index 09e9b74..b7bd2db 100755
--- a/fai/config/scripts/LOG_CLIENT/20-munin-node.conf
+++ b/fai/config/scripts/LOG_CLIENT/20-munin-node.conf
@@ -1,15 +1,12 @@
-#!/usr/sbin/cfagent -f
+#!/bin/bash
+#
+# allow the host syslog to access the munin node
+#
-control:
- any::
- actionsequence = ( editfiles )
- EditFileSize = ( 30000 )
+set -e
-editfiles:
- any::
- { ${target}/etc/munin/munin-node.conf
- BeginGroupIfNoSuchLine "allow ^10\\.0\\.0\\.1$"
- LocateLineMatching "allow \^127\\\.0\\\.0\\\.1\$"
- InsertLine "allow ^10\\.0\\.0\\.1$"
- EndGroup
- }
+IP=`host syslog | tail -n 1 | awk '{print $NF}'| sed "s%\.%\\\\\\\.%g"`
+
+if [ -n $IP ] ; then
+ 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