mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-22 02:51:03 +00:00
Added instance port number for better understanding
This commit is contained in:
parent
a3dadfa699
commit
3e548c97a8
1 changed files with 5 additions and 4 deletions
|
@ -41,10 +41,11 @@ module Munin
|
||||||
|
|
||||||
# run main method
|
# run main method
|
||||||
def run
|
def run
|
||||||
pids = get_pids()
|
instances = get_pids()
|
||||||
pids.sort.each do |pid|
|
instances.each do |instance|
|
||||||
|
pid, port = instance.split("|")
|
||||||
rss = (pid_rss(pid).to_i)/1024
|
rss = (pid_rss(pid).to_i)/1024
|
||||||
puts "thin_#{pid}.value #{rss}"
|
puts "thin_#{port}.value #{rss}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -60,7 +61,7 @@ module Munin
|
||||||
|
|
||||||
# fetch all pids that match thin
|
# fetch all pids that match thin
|
||||||
def get_pids
|
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
|
end
|
||||||
|
|
||||||
def autoconf
|
def autoconf
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue