1
0
Fork 0
mirror of https://github.com/munin-monitoring/contrib.git synced 2025-07-24 18:07:20 +00:00

Initial version

This commit is contained in:
Wesley Moxam 2009-02-12 20:10:59 +01:00 committed by Steve Schnepp
parent 5dc14c9795
commit d5bff8046e

32
plugins/other/passenger_memory Executable file
View file

@ -0,0 +1,32 @@
#!/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_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}"