From 21f63bf93d90219a836166bbf0883755e4248989 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Sat, 3 Dec 2022 15:45:30 +0000 Subject: [PATCH] Allow exim exporter to enumerate other processes --- cookbooks/exim/recipes/default.rb | 1 + cookbooks/prometheus/resources/exporter.rb | 2 ++ 2 files changed, 3 insertions(+) diff --git a/cookbooks/exim/recipes/default.rb b/cookbooks/exim/recipes/default.rb index 26a07e3ae..30617cc8e 100644 --- a/cookbooks/exim/recipes/default.rb +++ b/cookbooks/exim/recipes/default.rb @@ -225,6 +225,7 @@ munin_plugin "exim_mailstats" prometheus_exporter "exim" do port 9636 user "Debian-exim" + protect_proc "default" end if node[:exim][:smarthost_name] diff --git a/cookbooks/prometheus/resources/exporter.rb b/cookbooks/prometheus/resources/exporter.rb index d0ee20215..ac970426b 100644 --- a/cookbooks/prometheus/resources/exporter.rb +++ b/cookbooks/prometheus/resources/exporter.rb @@ -30,6 +30,7 @@ property :user, :kind_of => String property :command, :kind_of => String property :options, :kind_of => [String, Array] property :environment, :kind_of => Hash, :default => {} +property :protect_proc, String property :proc_subset, String property :private_devices, [true, false] property :protect_clock, [true, false] @@ -52,6 +53,7 @@ action :create do environment new_resource.environment exec_start "#{executable_path} #{new_resource.command} #{executable_options}" sandbox :enable_network => true + protect_proc new_resource.protect_proc if new_resource.property_is_set?(:protect_proc) proc_subset new_resource.proc_subset if new_resource.property_is_set?(:proc_subset) private_devices new_resource.private_devices if new_resource.property_is_set?(:private_devices) protect_clock new_resource.protect_clock if new_resource.property_is_set?(:protect_clock) -- 2.39.5