From 6ec9cb5539c380fae8852c03dc8adef5c50c4a51 Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sat, 12 Sep 2020 15:42:56 +0900 Subject: [PATCH] Deploy `supervisord` config for `alertmanager`. --- cookbooks/prometheus/alertmanager_setup.rb | 9 +++++++++ .../files/etc/supervisor/conf.d/alertmanager.conf | 8 ++++++++ 2 files changed, 17 insertions(+) create mode 100644 cookbooks/prometheus/files/etc/supervisor/conf.d/alertmanager.conf diff --git a/cookbooks/prometheus/alertmanager_setup.rb b/cookbooks/prometheus/alertmanager_setup.rb index 60af3ac..2620ea7 100644 --- a/cookbooks/prometheus/alertmanager_setup.rb +++ b/cookbooks/prometheus/alertmanager_setup.rb @@ -27,6 +27,15 @@ end end end +# Deploy `supervisord` config: +remote_file '/etc/supervisor/conf.d/alertmanager.conf' do + owner 'root' + group 'root' + mode '644' + + notifies :restart, 'service[supervisor]' +end + # Restart the `supervisor`: service 'supervisor' do action :nothing diff --git a/cookbooks/prometheus/files/etc/supervisor/conf.d/alertmanager.conf b/cookbooks/prometheus/files/etc/supervisor/conf.d/alertmanager.conf new file mode 100644 index 0000000..394808c --- /dev/null +++ b/cookbooks/prometheus/files/etc/supervisor/conf.d/alertmanager.conf @@ -0,0 +1,8 @@ +[program:alertmanager] +command=/usr/local/bin/alertmanager --config.file /etc/prometheus.d/alertmanager.yml +stdout_logfile=/var/log/supervisor/alertmanager.log +redirect_stderr=true +stdout_logfile_maxbytes=1MB +stdout_logfile_backups=5 +autorestart=true +stopsignal=HUP