4 require "rexml/document"
7 @passenger_status ||= REXML::Document.new(`/usr/sbin/passenger-status --show=xml`)
12 graph_args --base 1000 --lower-limit 0
13 graph_category passenger
14 graph_title Passenger requests
15 graph_vlabel requests / ${graph_period}
23 groups = passenger_status.get_elements("//supergroup").map do |supergroup|
24 supergroup.text("name")
27 groups.sort.each do |name|
28 puts "#{name}.label #{name}"
29 puts "#{name}.type DERIVE"
30 puts "#{name}.max 1000000"
38 passenger_status.get_elements("//supergroup").map do |supergroup|
39 name = supergroup.text("name")
42 supergroup.get_elements("group/processes/process").each do |process|
43 requests += process.text("processed").to_i
46 total_requests += requests
48 puts "#{name}.value #{requests}"
51 puts "total.value #{total_requests}"
54 if ARGV[0] == "config"