diff --git a/cookbooks/prometheus-exporters/files/etc/systemd/system/filestat_exporter.service b/cookbooks/prometheus-exporters/files/etc/systemd/system/filestat_exporter.service new file mode 100644 index 0000000..6136353 --- /dev/null +++ b/cookbooks/prometheus-exporters/files/etc/systemd/system/filestat_exporter.service @@ -0,0 +1,11 @@ +[Unit] +Description=Filestat Exporter + +[Service] +User=root +Group=root +ExecStart=/usr/local/bin/filestat_exporter --config.file=/etc/prometheus_exporters.d/filestat.yml + +[Install] +WantedBy=multi-user.target + diff --git a/cookbooks/prometheus-exporters/filestat_exporter_setup.rb b/cookbooks/prometheus-exporters/filestat_exporter_setup.rb index 71b2a9f..690e316 100644 --- a/cookbooks/prometheus-exporters/filestat_exporter_setup.rb +++ b/cookbooks/prometheus-exporters/filestat_exporter_setup.rb @@ -7,13 +7,15 @@ remote_file '/etc/prometheus_exporters.d/filestat.yml' do notifies :restart, 'service[supervisor]' end -# Deploy the `supervisord` configuration: -remote_file '/etc/supervisor/conf.d/filestat_exporter.conf' do +# Deploy the `systemd` configuration: +remote_file '/etc/systemd/system/filestat_exporter.service' do owner 'root' group 'root' mode '644' +end - notifies :restart, 'service[supervisor]' +service 'filestat_exporter' do + action [:enable, :start] end # Deploy `consul` config for `node_exporter`: