mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-25 18:38:30 +00:00
Initial version
This commit is contained in:
parent
5dc14c9795
commit
d5bff8046e
1 changed files with 32 additions and 0 deletions
32
plugins/other/passenger_memory
Executable file
32
plugins/other/passenger_memory
Executable 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}"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue