From b87bdc899aaa7016bd209f196bc54cbde332b7ee Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 2 May 2021 19:19:00 +0900 Subject: [PATCH 1/3] Delete the unnecessary attributes. --- cookbooks/prometheus-exporters/attributes.rb | 22 -------------------- 1 file changed, 22 deletions(-) diff --git a/cookbooks/prometheus-exporters/attributes.rb b/cookbooks/prometheus-exporters/attributes.rb index 221f13f..d39fc78 100644 --- a/cookbooks/prometheus-exporters/attributes.rb +++ b/cookbooks/prometheus-exporters/attributes.rb @@ -2,14 +2,6 @@ # Specifying the default settings: # ------------------------------------------- node.reverse_merge!({ - 'prometheus' => { - 'manager' => false, - 'url' => 'https://github.com/prometheus/prometheus/releases/download/', - 'prefix' => 'prometheus-', - 'postfix' => '.linux-amd64.tar.gz', - 'storage' => '/opt/prometheus/', - 'location' => '/usr/local/bin/' - }, 'node_exporter' => { 'url' => 'https://github.com/prometheus/node_exporter/releases/download/', 'prefix' => 'node_exporter-', @@ -24,20 +16,6 @@ node.reverse_merge!({ 'storage' => '/opt/blackbox_exporter/bin/', 'location' => '/usr/local/bin/' }, - 'alertmanager' => { - 'url' => 'https://github.com/prometheus/alertmanager/releases/download/', - 'prefix' => 'alertmanager-', - 'postfix' => '.linux-amd64.tar.gz', - 'storage' => '/opt/prometheus/', - 'location' => '/usr/local/bin/' - }, - 'alertmanager_webhook' => { - 'url' => 'https://github.com/tomtom-international/alertmanager-webhook-logger/releases/download/', - 'prefix' => 'alertmanager-webhook-logger-', - 'postfix' => '.tar.gz', - 'storage' => '/opt/prometheus/', - 'location' => '/usr/local/bin/' - }, 'filestat_exporter' => { 'url' => 'https://github.com/michael-doubez/filestat_exporter/releases/download/', 'prefix' => 'filestat_exporter-', From 2bcbc2f396b8a654e79f4cd6dd1af90047e0fb28 Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 2 May 2021 19:19:38 +0900 Subject: [PATCH 2/3] Modify the extention to `.zip`. --- cookbooks/prometheus/attributes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbooks/prometheus/attributes.rb b/cookbooks/prometheus/attributes.rb index 3c90455..a671089 100644 --- a/cookbooks/prometheus/attributes.rb +++ b/cookbooks/prometheus/attributes.rb @@ -34,7 +34,7 @@ node.reverse_merge!({ 'alertmanager_webhook' => { 'url' => 'https://github.com/tomtom-international/alertmanager-webhook-logger/releases/download/', 'prefix' => 'alertmanager-webhook-logger-', - 'postfix' => '.tar.gz', + 'postfix' => '.zip', 'storage' => '/opt/prometheus/', 'location' => '/usr/local/bin/' }, From ff39013b2c357d4be9a0c0db0f8c1566e17e73e1 Mon Sep 17 00:00:00 2001 From: Kazuhiro MUSASHI Date: Sun, 2 May 2021 19:20:39 +0900 Subject: [PATCH 3/3] Install `alertmanager-webhook`. --- cookbooks/prometheus/alertmanager_webhook_install.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cookbooks/prometheus/alertmanager_webhook_install.rb b/cookbooks/prometheus/alertmanager_webhook_install.rb index 23f48bc..0420e26 100644 --- a/cookbooks/prometheus/alertmanager_webhook_install.rb +++ b/cookbooks/prometheus/alertmanager_webhook_install.rb @@ -35,7 +35,9 @@ directory node['alertmanager_webhook']['storage'] do mode '755' end -execute "tar zxf #{TMP} -C #{node['alertmanager_webhook']['storage']}" +execute "unzip #{TMP} -d #{node['alertmanager_webhook']['storage']}" do + not_if "test -e #{node['alertmanager_webhook']['storage']}alertmanager-webhook-logger" +end # Change Owner and Permissions: file "#{node['alertmanager_webhook']['storage']}alertmanager-webhook-logger" do