dd
Some checks are pending
ci/woodpecker/push/gitleaks Pipeline was successful
ci/woodpecker/push/ansible-lint Pipeline is running
ci/woodpecker/pr/gitleaks Pipeline was successful
ci/woodpecker/pr/ansible-lint Pipeline is running

This commit is contained in:
Michael Grote 2024-08-12 16:05:07 +02:00
parent dfc02ee4b0
commit da1b36de16
5 changed files with 8 additions and 35 deletions

View file

@ -21,6 +21,7 @@ services:
/root@pbs.localdomain/ pbs@mgrote.net
/root@pve5.localdomain/ pve5@mgrote.net
/no-reply@ubnt.com/ ubiquity@mgrote.net
/mg@munin.localdomain/ munin@mgrote.net
# rewrite FROM "nobody@lldap" to "lldap@mgrote.net"
# /.*/ würde alle absender adressen ersetzen
networks:

View file

@ -42,6 +42,8 @@ munin_node_bind_port: "4949"
munin_node_allowed_cidrs: [127.0.0.1]
### mgrote_munin_master
munin_enable_alerts: true
munin_alerts_to: info@mgrote.net
munin_hosts:
- name: "{{ ansible_fqdn }}.mgrote.net"
address: "127.0.0.1"

View file

@ -25,6 +25,8 @@ munin_server_plugins:
- munin_update
munin_cron_job: present
munin_dbdir: "/var/lib/munin"
munin_enable_alerts: true
munin_alerts_to: nobody@nowhere.com
munin_hosts:
- name: "{{ ansible_fqdn }}"
address: "127.0.0.1"

View file

@ -59,40 +59,6 @@
create: true
mode: '0644'
# TODO mail config? wie senden?
# COPY munin_mail.conf /etc/munin/munin-conf.d/munin_mail.conf
# # configure mail notification
# if [[ -n "$MAILCONTACT" && -n "$MAILSERVER" && -n "$MAILPORT" && -n "$MAILUSER" && -n "$MAILPASSWORD" && -n "$MAILDOMAIN" ]] ; then
# MAILCONTACT=${MAILCONTACT:="contact@domain.test"}
# sed -i "s/mailcontact/$MAILCONTACT/g" /etc/ssmtp/ssmtp.conf
# sed -i "s/mailcontact/$MAILCONTACT/g" /etc/munin/munin-conf.d/munin_mail.conf
# MAILSERVER=${MAILSERVER:="mail.domain.test"}
# sed -i "s/mailserver/$MAILSERVER/g" /etc/ssmtp/ssmtp.conf
# sed -i "s/mailserver/$MAILSERVER/g" /etc/ssmtp/revaliases
# MAILPORT=${MAILPORT:="25"}
# sed -i "s/mailport/$MAILPORT/g" /etc/ssmtp/ssmtp.conf
# sed -i "s/mailport/$MAILPORT/g" /etc/ssmtp/revaliases
# MAILUSER=${MAILUSER:="alert@domain.test"}
# sed -i "s/mailuser/$MAILUSER/g" /etc/ssmtp/ssmtp.conf
# MAILFROM=${MAILFROM:="munin@domain.test"}
# sed -i "s/mailfrom/$MAILFROM/g" /etc/ssmtp/revaliases
# MAILPASSWORD=${MAILPASSWORD:="XXXXXXXXX"}
# sed -i "s/mailpassword/$MAILPASSWORD/g" /etc/ssmtp/ssmtp.conf
# MAILDOMAIN=${MAILDOMAIN:="domain.test"}
# sed -i "s/maildomain/$MAILDOMAIN/g" /etc/ssmtp/ssmtp.conf
# sed -i "s/mailhost/$MAILDOMAIN/g" /etc/ssmtp/ssmtp.conf
# MAILNAME=${MAILNAME:="Munin"}
# sed -i "s/munin application user/$MAILNAME/g" /etc/passwd
# else
# rm /etc/munin/munin-conf.d/munin_mail.conf /etc/ssmtp/ssmtp.conf
# fi
# cronjoib? timer? TODO
# sed -i "s/\*\/5/\*\/5/g" /etc/cron.d/munin kommt imho aus paket
- name: check if munin has been run
ansible.builtin.stat:
path: /var/cache/munin/www/index.html

View file

@ -89,7 +89,9 @@ includedir /etc/munin/munin-conf.d
# Drop somejuser@fnord.comm and anotheruser@blibb.comm an email everytime
# something changes (OK -> WARNING, CRITICAL -> OK, etc)
#contact.someuser.command mail -s "Munin ${var:worst}: ${var:group}::${var:host}::${var:plugin}" somejuser@fnord.comm
{% if munin_enable_alerts is sameas true %}
#contact.someuser.command mail -s "Munin ${var:worst}: ${var:group}::${var:host}::${var:plugin}" {{ munin_alerts_to }}
{% endif %}
#contact.anotheruser.command mail -s "Munin ${var:worst}: ${var:group}::${var:host}::${var:plugin}" anotheruser@blibb.comm
#
# For those with Nagios, the following might come in handy. In addition,