From 05eca610df3e4e3790f5ae5aec8a8fe10fb74f05 Mon Sep 17 00:00:00 2001 From: "github@kiekerjan.isdronken.nl" Date: Tue, 13 Apr 2021 22:31:20 +0200 Subject: [PATCH] Check munin plugins existence and add fail2ban --- setup/munin.sh | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/setup/munin.sh b/setup/munin.sh index 5b95fde2..09526e7c 100755 --- a/setup/munin.sh +++ b/setup/munin.sh @@ -72,9 +72,21 @@ hide_output systemctl unmask munin.service hide_output systemctl enable munin.service # Some more munin plugins -ln -fs /usr/share/munin/plugins/postfix_mailstats /etc/munin/plugins/ -ln -fs /usr/share/munin/plugins/spamstats /etc/munin/plugins -ln -fs /usr/share/munin/plugins/df_abs /etc/munin/plugins +if [ -f /usr/share/munin/plugins/postfix_mailstats ] && [ ! -h /etc/munin/plugins/postfix_mailstats ]; then + ln -fs /usr/share/munin/plugins/postfix_mailstats /etc/munin/plugins/ +fi + +if [ -f /usr/share/munin/plugins/spamstats ] && [ ! -h /etc/munin/plugins/spamstats ]; then + ln -fs /usr/share/munin/plugins/spamstats /etc/munin/plugins/ +fi + +if [ -f /usr/share/munin/plugins/df_abs ] && [ ! -h /etc/munin/plugins/df_abs ]; then + ln -fs /usr/share/munin/plugins/df_abs /etc/munin/plugins/ +fi + +if [ -f /usr/share/munin/plugins/fail2ban ] && [ ! -h /etc/munin/plugins/fail2ban ]; then + ln -fs /usr/share/munin/plugins/fail2ban /etc/munin/plugins/ +fi # Restart services. restart_service munin