mirror of
https://github.com/munin-monitoring/contrib.git
synced 2025-07-21 18:41:03 +00:00
Fixed thin_threads which reported 0 all the time
This commit is contained in:
parent
f847a3a425
commit
9ec552e04e
1 changed files with 2 additions and 2 deletions
|
@ -44,7 +44,7 @@ module Munin
|
||||||
instances = get_pids()
|
instances = get_pids()
|
||||||
instances.each do |instance|
|
instances.each do |instance|
|
||||||
pid, port = instance.split("|")
|
pid, port = instance.split("|")
|
||||||
rss = (get_threads(pid).to_i)/1024
|
rss = (get_threads(pid).to_i)
|
||||||
puts "thin_#{port}.value #{rss}"
|
puts "thin_#{port}.value #{rss}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -55,7 +55,7 @@ module Munin
|
||||||
# TODO: make this work on OSX and Solaris,
|
# TODO: make this work on OSX and Solaris,
|
||||||
# so the whole unix gang is happy ;)
|
# so the whole unix gang is happy ;)
|
||||||
def get_threads(pid)
|
def get_threads(pid)
|
||||||
res = `grep "Threads" /proc/#{pid}/status`.split[1]
|
res = `grep "Threads" /proc/#{pid}/status | cut -d ":" -f2`.gsub(/\s+/, "")
|
||||||
if res.match("cannot access")
|
if res.match("cannot access")
|
||||||
return nil
|
return nil
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue