X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/7b9ec4b60ee39614d1d083d7220e76b07d2b275f..90a349e0bc558441e65156eabb585c578d93fbfd:/cookbooks/munin/files/default/plugins/passenger_queues diff --git a/cookbooks/munin/files/default/plugins/passenger_queues b/cookbooks/munin/files/default/plugins/passenger_queues index 9a67fafc7..8d4159b46 100755 --- a/cookbooks/munin/files/default/plugins/passenger_queues +++ b/cookbooks/munin/files/default/plugins/passenger_queues @@ -1,24 +1,26 @@ #!/usr/bin/env ruby +require "English" + def output_config - puts <<-END -graph_category passenger -graph_title Passenger queues -graph_vlabel count + puts <<~END + graph_category passenger + graph_title Passenger queues + graph_vlabel count -global.label global -END + global.label global + END exit 0 end def output_values status = `/usr/sbin/passenger-status` - unless $?.success? + unless $CHILD_STATUS.success? $stderr.puts "failed executing passenger-status" exit 1 end - status =~ /Waiting on global queue:\s+(\d+)/ - puts "global.value #{$1}" + status =~ /Requests in top-level queue :\s+(\d+)/ + puts "global.value #{Regexp.last_match[1]}" end if ARGV[0] == "config"