diff --git a/cookbooks/prometheus-exporters/files/etc/rsyslog.d/30-filestat_exporter.conf b/cookbooks/prometheus-exporters/files/etc/rsyslog.d/30-filestat_exporter.conf new file mode 100644 index 0000000..d0167fd --- /dev/null +++ b/cookbooks/prometheus-exporters/files/etc/rsyslog.d/30-filestat_exporter.conf @@ -0,0 +1,7 @@ +# Log kernel generated digdag log messages to file +:syslogtag,contains,"filestat_exporter" /var/log/filestat_exporter.log + +# Uncomment the following to stop logging anything that matches the last rule. +# Doing this will stop logging kernel generated UFW log messages to the file +# normally containing kern.* messages (eg, /var/log/kern.log) +& stop diff --git a/cookbooks/prometheus-exporters/filestat_exporter_setup.rb b/cookbooks/prometheus-exporters/filestat_exporter_setup.rb index 2d4b6aa..5fa3580 100644 --- a/cookbooks/prometheus-exporters/filestat_exporter_setup.rb +++ b/cookbooks/prometheus-exporters/filestat_exporter_setup.rb @@ -18,6 +18,19 @@ service 'filestat_exporter' do action [:enable, :start] end +# Deploy `rsyslog` config: +remote_file '/etc/rsyslog.d/30-filestat_exporter.conf' do + owner 'root' + group 'root' + mode '644' + + notifies :restart, 'service[rsyslog]' +end + +service 'rsyslog' do + action :nothing +end + # Deploy `consul` config for `filestat_exporter`: remote_file '/etc/consul.d/service-filestat_exporter.json' do owner 'consul'