Deploy `systemd` config for `node_exporter`.

This commit is contained in:
Kazuhiro MUSASHI 2023-02-05 19:05:42 +09:00
parent 5bf5eac091
commit 0bfd4a7d53
3 changed files with 22 additions and 2 deletions

View File

@ -0,0 +1 @@
OPTIONS=' --web.listen-address="127.0.0.1:9100" --collector.systemd'

View File

@ -0,0 +1,11 @@
[Unit]
Description=Node Exporter
[Service]
User=root
Group=root
EnvironmentFile=-/etc/default/node_exporter
ExecStart=/usr/local/bin/node_exporter $OPTIONS
[Install]
WantedBy=multi-user.target

View File

@ -1,10 +1,18 @@
# Deploy the `supervisord` configuration:
remote_file '/etc/supervisor/conf.d/node_exporter.conf' do
remote_file '/etc/systemd/system/node_exporter.service' do
owner 'root'
group 'root'
mode '644'
end
notifies :restart, 'service[supervisor]'
remote_file '/etc/default/node_exporter' do
owner 'root'
group 'root'
mode '644'
end
service 'node_exporter' do
action [ :enable, :start]
end
# Deploy `consul` config for `node_exporter`: