Deploy `snmp_exporter` service and enable it.
This commit is contained in:
parent
44cede10da
commit
83484ff4a5
|
@ -1,8 +0,0 @@
|
||||||
[program:snmp_exporter]
|
|
||||||
command=/usr/local/bin/snmp_exporter --config.file /etc/prometheus_exporters.d/snmp.yml
|
|
||||||
stdout_logfile=/var/log/supervisor/snmp_exporter.log
|
|
||||||
redirect_stderr=true
|
|
||||||
stdout_logfile_maxbytes=1MB
|
|
||||||
stdout_logfile_backups=5
|
|
||||||
autorestart=true
|
|
||||||
stopsignal=HUP
|
|
|
@ -0,0 +1,10 @@
|
||||||
|
[Unit]
|
||||||
|
Description=SNMP Exporter
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
User=root
|
||||||
|
Group=root
|
||||||
|
ExecStart=/usr/local/bin/snmp_exporter --config.file /etc/prometheus_exporters.d/snmp.yml
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
|
@ -3,13 +3,15 @@ link '/etc/prometheus_exporters.d/snmp.yml' do
|
||||||
to "#{node['snmp_exporter']['storage']}snmp.yml"
|
to "#{node['snmp_exporter']['storage']}snmp.yml"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Deploy `supervisord` config:
|
# Deploy `systemd` config:
|
||||||
remote_file '/etc/supervisor/conf.d/snmp_exporter.conf' do
|
remote_file '/etc/systemd/system/snmp_exporter.service' do
|
||||||
owner 'root'
|
owner 'root'
|
||||||
group 'root'
|
group 'root'
|
||||||
mode '644'
|
mode '644'
|
||||||
|
end
|
||||||
|
|
||||||
notifies :restart, 'service[supervisor]'
|
service 'snmp_exporter' do
|
||||||
|
action [:enable, :start]
|
||||||
end
|
end
|
||||||
|
|
||||||
# Deploy `consul` config:
|
# Deploy `consul` config:
|
||||||
|
|
Loading…
Reference in New Issue