forked from shaf/docker-munin-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·33 lines (27 loc) · 1.13 KB
/
start.sh
File metadata and controls
executable file
·33 lines (27 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
# Apply munin-node allowed hosts
if [ ! -z ${ALLOWED_HOSTS+x} ]; then
sed -i -e 's@^cidr_allow.*@cidr_allow '"$ALLOWED_HOSTS"'@' /etc/munin/munin-node.conf
fi
# Apply user defined server name from ENV
if [ ! -z ${HOSTNAME+x} ]; then
sed -ie 's@localhost.localdomain@'"$HOSTNAME"'@g' /etc/munin/munin.conf
fi
# Set timezone if supplied ENV{TZ} is valid
if [ -f "/usr/share/zoneinfo/$TZ" ]; then
rm /etc/localtime
ln -s "/usr/share/zoneinfo/$TZ" /etc/localtime
fi
# Create holding page if no stats are available
if [ ! -e /var/cache/munin/www/index.html ]; then
echo "NEW INSTALLATION: Charts will be available within 5 minutes, thank you for waiting..." > /var/cache/munin/www/index.htm
fi
munin-node-configure --remove --shell | sh
ln -s /usr/share/munin/plugins/hddtemp_smartctl /etc/munin/plugins/hddtemp_smartctl
ln -s /usr/share/munin/plugins/iostat /etc/munin/plugins/iostat
ln -s /usr/share/munin/plugins/meminfo /etc/munin/plugins/meminfo
printf '[docker_*]\nuser root\n' > /etc/munin/plugin-conf.d/docker
service cron start
a2enmod cgid
service apache2 start
exec /usr/sbin/munin-node --config /etc/munin/munin-node.conf