mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Reduce number of categories
riak -> other (riak) smf -> forum (smf) reddit -> other (reddit) sge -> htc (sge) netscaler -> loadbalancer (netscaler) nutcracker -> other (twemproxy) requesttracker -> other (requesttracker) passenger -> webserver (passenger) gearman -> other (gearman)
This commit is contained in:
parent
212768ed9b
commit
63351ab535
20 changed files with 19 additions and 19 deletions
33
plugins/passenger/passenger_memory
Executable file
33
plugins/passenger/passenger_memory
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/usr/bin/env ruby
|
||||
#
|
||||
# Be sure to configure this node in the plugin configuration
|
||||
# Memory stats must be run by root
|
||||
# Ex:
|
||||
# [passenger_memory]
|
||||
# user root
|
||||
# env.memory_stats_command path_to_passenger-memory-stats
|
||||
#
|
||||
|
||||
memory_stats_command = ENV['memory_stats_command'] || '/opt/ruby-enterprise-1.8.6-20080810/bin/passenger-memory-stats'
|
||||
|
||||
if ARGV.length > 0 && ARGV[0] == 'config'
|
||||
puts "graph_title Passenger Memory Usage"
|
||||
puts "graph_category webserver"
|
||||
puts "graph_vlabel MB"
|
||||
puts "apache_rss.label Apache Dirty RSS"
|
||||
puts "passenger_rss.label Passenger Dirty RSS"
|
||||
exit(0)
|
||||
end
|
||||
|
||||
apache_rss = nil
|
||||
passenger_rss = nil
|
||||
|
||||
`#{memory_stats_command}`.each_line do |line|
|
||||
next unless /### Total private dirty RSS: (\d+\.\d+) MB/.match(line)
|
||||
passenger_rss = $~[1] unless apache_rss.nil?
|
||||
apache_rss ||= $~[1]
|
||||
end
|
||||
|
||||
puts "apache_rss.value #{apache_rss}"
|
||||
puts "passenger_rss.value #{passenger_rss}"
|
||||
|
42
plugins/passenger/passenger_processes
Executable file
42
plugins/passenger/passenger_processes
Executable file
|
@ -0,0 +1,42 @@
|
|||
#!/usr/bin/env ruby
|
||||
#
|
||||
# [passenger_processes]
|
||||
# user root
|
||||
# env.process_stats_command /opt/ruby-enterprise-1.8.6-20080810/bin/passenger-status
|
||||
#
|
||||
|
||||
process_stats_command = ENV['process_stats_command'] || '/opt/ruby-enterprise-1.8.6-20080810/bin/passenger-status'
|
||||
|
||||
if ARGV.length > 0 && ARGV[0] == 'config'
|
||||
puts "graph_title Passenger Processes"
|
||||
puts "graph_category webserver"
|
||||
puts "graph_vlabel processes"
|
||||
puts "max.label Max processes"
|
||||
puts "count.label Total processes"
|
||||
puts "active.label Active processes"
|
||||
puts "queued.label Queued requests"
|
||||
exit(0)
|
||||
end
|
||||
|
||||
max = nil
|
||||
count = nil
|
||||
active = nil
|
||||
queued = nil
|
||||
|
||||
`#{process_stats_command}`.each_line do |line|
|
||||
if /max\s+=\s+(\d+)/.match(line)
|
||||
max = $~[1]
|
||||
elsif /count\s+=\s+(\d+)/.match(line)
|
||||
count = $~[1]
|
||||
elsif /^active\s+=\s+(\d+)/.match(line)
|
||||
active = $~[1]
|
||||
elsif /Waiting on global queue\s+=\s+(\d+)/.match(line)
|
||||
queued = $~[1]
|
||||
end
|
||||
end
|
||||
|
||||
puts "max.value #{max}"
|
||||
puts "count.value #{count}"
|
||||
puts "active.value #{active}"
|
||||
puts "queued.value #{queued.to_i}"
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
def output_config
|
||||
puts <<-END
|
||||
graph_category passenger
|
||||
graph_category webserver
|
||||
graph_title status
|
||||
graph_vlabel count
|
||||
graph_info This graph shows how much passenger process are working, available and how much queries are waiting.
|
||||
|
@ -52,4 +52,4 @@ if ARGV[0] == "config"
|
|||
output_config
|
||||
else
|
||||
output_values
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue