Installation and deployment, self-starting and writing independent log files
alertmanager.yml
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 49
| global: resolve_timeout: 5m smtp_from: smtp_smarthost: smtp_auth_username: smtp_auth_password: smtp_require_tls: false route: group_by: [ group_wait: 10s group_interval: 1m repeat_interval: 10m receiver: routes: - receiver: group_wait: 30s group_interval: 2m repeat_interval: 3m continue: true match: env: Alitest - receiver: group_by: [ continue: true match: type: host - receiver: match: resource:memory receivers: - name: webhook_configs: - url: - name: webhook_configs: - url: - name: webhook_configs: - url: - name: email_configs: - to: send_resolved: true inhibit_rules: - source_match: severity: target_match: severity: equal: [
|
/etc/systemd/system/alertmanager.service
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| [Unit] Description=Prometheus Documentation=https://prometheus.io/docs/introduction/overview/ After=network.target
[Service] User=prometheus Group=prometheus ExecStart=/opt/soft/monitor/alertmanager-0.25.0.linux-amd64/alertmanager --config.file /opt/soft/monitor/alertmanager-0.25.0.linux-amd64/alertmanager.yml --storage.path /opt/soft/monitor/alertmanager-0.25.0.linux-amd64/data StandardOutput=syslog StardardError=syslog SyslogIdentifier=alertmanager Restart=always
[Install] WantedBy=multi-user.target
|
/etc/rsyslog.d/alertmanager.conf
1 2 3 4 5
| #!/bin/bash if ($programname == "alertmanager")then{ action(type="omfile" file="/var/log/alertmanager.log") stop }
|