1
0
Fork 0
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:
Thomas VIAL 2013-04-04 10:00:04 +02:00
parent f847a3a425
commit 9ec552e04e

View file

@ -44,7 +44,7 @@ module Munin
instances = get_pids()
instances.each do |instance|
pid, port = instance.split("|")
rss = (get_threads(pid).to_i)/1024
rss = (get_threads(pid).to_i)
puts "thin_#{port}.value #{rss}"
end
end
@ -55,7 +55,7 @@ module Munin
# TODO: make this work on OSX and Solaris,
# so the whole unix gang is happy ;)
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")
return nil
else