From 69f7035247fe225b9a4ce3c3274d79005dca0cea Mon Sep 17 00:00:00 2001 From: k clair Date: Fri, 21 Sep 2012 16:40:50 -0700 Subject: have passenger_stats munin script take an environment variable for the location of passenger-status --- files/munin/passenger_stats | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/files/munin/passenger_stats b/files/munin/passenger_stats index a117903..f06e88a 100755 --- a/files/munin/passenger_stats +++ b/files/munin/passenger_stats @@ -1,5 +1,7 @@ #!/usr/bin/env ruby +PASSENGER_STATUS = ENV['passenger_status'] || '/usr/local/bin/passenger-status' + def output_config puts <<-END graph_category Passenger @@ -16,7 +18,7 @@ END end def output_values - status = `/usr/sbin/passenger-status` + status = `#{PASSENGER_STATUS}` unless $?.success? $stderr.puts "failed executing passenger-status" exit 1 -- cgit v1.2.3 From c43a7daea169f4b031cf73795c5163e7ec6c1e13 Mon Sep 17 00:00:00 2001 From: k clair Date: Fri, 21 Sep 2012 16:59:10 -0700 Subject: add a variable $passenger_bin_path to the passenger class --- manifests/init.pp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 22be7cf..12788f4 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -10,7 +10,8 @@ class passenger ( $use_gems = false, $use_munin = true, $passenger_ensure_version = 'installed', - $librack_ensure_version = 'installed' ) + $librack_ensure_version = 'installed', + $passenger_bin_path = '/usr/sbin' ) { if ! $use_gems { @@ -48,11 +49,11 @@ class passenger ( if $use_munin { case $passenger_memory_munin_config { '': - { $passenger_memory_munin_config = "user root\nenv.passenger_memory_stats /usr/sbin/passenger-memory-stats" } + { $passenger_memory_munin_config = "user root\nenv.passenger_memory_stats $passenger_bin_path/passenger-memory-stats" } } case $passenger_stats_munin_config { '': - { $passenger_stats_munin_config = "user root\n" } + { $passenger_stats_munin_config = "user root\nenv.passenger_status $passenger_bin_path/passenger-status" } } munin::plugin::deploy { -- cgit v1.2.3