2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Added instance port number for better understanding

This commit is contained in:
Thomas VIAL 2013-02-15 09:18:13 +01:00
parent a3dadfa699
commit 3e548c97a8

View File

@ -41,10 +41,11 @@ module Munin
# run main method
def run
pids = get_pids()
pids.sort.each do |pid|
instances = get_pids()
instances.each do |instance|
pid, port = instance.split("|")
rss = (pid_rss(pid).to_i)/1024
puts "thin_#{pid}.value #{rss}"
puts "thin_#{port}.value #{rss}"
end
end
@ -60,7 +61,7 @@ module Munin
# fetch all pids that match thin
def get_pids
pids = `pgrep thin`.split
pids = `pgrep -f 'thin' -l | awk -F " " '{ if (substr( $4, 10, 4)>=1) print $1"|"substr( $4, 10, 4)}'`.split(/\r?\n/)
end
def autoconf