Deploy the `systemd` config for monitoring `snmp_exporter` logs.

This commit is contained in:
Kazuhiro MUSASHI 2020-10-25 00:16:55 +09:00
parent 5a32a4bcec
commit 3aa5a8bb09
2 changed files with 24 additions and 0 deletions

View File

@ -0,0 +1,12 @@
[Unit]
Description=Grafana Promtail for snmp_exporter
Documentation=https://github.com/grafana/loki
After=network-online.target
[Service]
User=root
Restart=always
ExecStart=/usr/local/bin/promtail --config.file=/etc/promtail/snmp_exporter.yaml
[Install]
WantedBy=multi-user.target

View File

@ -36,3 +36,15 @@ template '/etc/promtail/snmp_exporter.yaml' do
notifies :restart, 'service[promtail-prometheus]'
end
# Deploy the `systemd` configuration:
remote_file '/lib/systemd/system/promtail-snmp_exporter.service' do
owner 'root'
group 'root'
mode '644'
end
# Service setting:
service 'promtail-snmp_exporter' do
action [ :enable, :restart ]
end