summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorB. van Berkum <dev@dotmpe.com>2017-10-08 00:22:56 +0200
committerB. van Berkum <dev@dotmpe.com>2017-10-08 00:22:56 +0200
commitb1761604d8ec6f4dff913f6e3dc2a6fea3dae7d0 (patch)
tree5e098b15f4365cd5268094021223bbc1a566c870
parent1ed62c531f44712bc7f86ed8f8bcf1afa8d01132 (diff)
downloadmunin-b1761604d8ec6f4dff913f6e3dc2a6fea3dae7d0.tar.gz
munin-b1761604d8ec6f4dff913f6e3dc2a6fea3dae7d0.tar.bz2
munin-b1761604d8ec6f4dff913f6e3dc2a6fea3dae7d0.tar.xz
munin-b1761604d8ec6f4dff913f6e3dc2a6fea3dae7d0.zip
Minor fixes and some verbosity improvements
-rw-r--r--Dockerfile2
-rw-r--r--nginx.conf2
-rwxr-xr-xstart-munin.sh14
3 files changed, 11 insertions, 7 deletions
diff --git a/Dockerfile b/Dockerfile
index e3cacde..c87f487 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -12,7 +12,7 @@ VOLUME /var/lib/munin
VOLUME /var/log/munin
ADD ./munin.conf /etc/munin/munin.conf
-AdD ./nginx.conf /etc/nginx/nginx.conf
+ADD ./nginx.conf /etc/nginx/nginx.conf
ADD ./nginx-munin /etc/nginx/sites-enabled/munin
ADD ./start-munin.sh /munin
ADD ./munin-graph-logging.patch /usr/share/munin
diff --git a/nginx.conf b/nginx.conf
index baac5b6..7fb8e46 100644
--- a/nginx.conf
+++ b/nginx.conf
@@ -26,5 +26,3 @@ http {
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
-
-
diff --git a/start-munin.sh b/start-munin.sh
index fef4449..e531dfd 100755
--- a/start-munin.sh
+++ b/start-munin.sh
@@ -49,7 +49,7 @@ fi
# generate the Munin auth username/password file
if [ ! -f /etc/munin/htpasswd.users ]; then
- uc = 0
+ uc=0
IFS=' ' read -ra ARR_USERS <<< "$MUNIN_USERS"
IFS=' ' read -ra ARR_PASSWORDS <<< "$MUNIN_PASSWORDS"
for u in "${ARR_USERS[@]}"; do
@@ -67,7 +67,7 @@ do
if [ ${#PORT} -eq 0 ]; then
PORT=4949
fi
- if ! grep -q $HOST /etc/munin/munin.conf ; then
+ if ! grep -q "'^$HOST$'" /etc/munin/munin.conf ; then
cat << EOF >> /etc/munin/munin.conf
[$NAME]
address $HOST
@@ -75,6 +75,7 @@ do
port $PORT
EOF
+ echo "Added node '$NAME' '$HOST'"
fi
done
@@ -87,7 +88,7 @@ do
if [ ${#PORT} -eq 0 ]; then
PORT=4949
fi
- if ! grep -q $HOST /etc/munin/munin.conf ; then
+ if ! grep -q "'^$HOST$'" /etc/munin/munin.conf ; then
cat << EOF >> /etc/munin/munin.conf
[$NAME]
address $HOST
@@ -95,6 +96,7 @@ do
port $PORT
EOF
+ echo "Added SNMP node '$NAME' '$HOST'"
fi
done
@@ -119,16 +121,20 @@ fi
/usr/sbin/rsyslogd
# start cron
/usr/sbin/cron
+# Issue: 'NUMBER OF HARD LINKS > 1' prevents cron exec in container
+# https://github.com/phusion/baseimage-docker/issues/198
+touch /etc/crontab /etc/cron.d/*
# start local munin-node
/usr/sbin/munin-node
echo "Using the following munin nodes:"
echo $NODES
+echo "(snmp) $SNMP_NODES"
# start spawn-cgi to enable CGI interface with munin (dynamix graph generation)
spawn-fcgi -s /var/run/munin/fcgi-graph.sock -U munin -u munin -g munin /usr/lib/munin/cgi/munin-cgi-graph
# start nginx
/usr/sbin/nginx
# show logs
-echo "Tailing /var/log/syslog..."
+echo "Tailing syslog and munin-update log..."
tail -F /var/log/syslog /var/log/munin/munin-update.log & pid=$!
echo "tail -F running in $pid"