-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
install-munin
executable file
·48 lines (41 loc) · 1.19 KB
/
install-munin
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
set -e
# shellcheck disable=SC1091
. /etc/weblate-bootstrap
# Set path to include script directory
PATH="$(dirname "$(readlink -f "$0")"):$PATH"
export PATH
# Munin
mkdir -p /etc/munin/plugin-conf.d/
cat > /etc/munin/plugin-conf.d/postgres <<EOT
[postgres_*]
user weblate
env.PGHOST 127.0.0.1
env.PGUSER weblate
env.PGPASSWORD weblate
EOT
cat > /etc/munin/plugin-conf.d/redis <<EOT
[redis]
env.host1 127.0.0.1
env.port1 6379
EOT
# Plugins
mkdir -p /usr/share/munin/plugins/
cd /usr/share/munin/plugins/
wget https://raw.githubusercontent.com/munin-monitoring/contrib/master/plugins/redis/redis
wget https://raw.githubusercontent.com/WeblateOrg/munin/master/weblate
wget https://raw.githubusercontent.com/WeblateOrg/munin/master/ksm
chmod +x redis weblate ksm
cat > /etc/munin/plugin-conf.d/weblate_servers <<EOT
[weblate]
env.SERVER https://$WEBLATE_DOMAIN/
env.KEY
EOT
create-monitor-user
# Install and configure munin
# The mkdir is needed on Ubuntu (used for CI)
mkdir /run/munin/
chmod 777 /run/munin/
apt install -y munin-node munin-plugins-extra libdbd-pg-perl libwww-perl libswitch-perl
sed -i "/allow.*::1/ a allow ^172\\\\.16\\\\.0\\\\.9\$" /etc/munin/munin-node.conf
systemctl restart munin-node