From 3e548c97a89f6ad079a019b4933994341a2a2703 Mon Sep 17 00:00:00 2001 From: Thomas VIAL Date: Fri, 15 Feb 2013 09:18:13 +0100 Subject: [PATCH] Added instance port number for better understanding --- plugins/thin/thin_memory | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/thin/thin_memory b/plugins/thin/thin_memory index afbb20d9..9eab4e84 100755 --- a/plugins/thin/thin_memory +++ b/plugins/thin/thin_memory @@ -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