God on Solaris

3 views
Skip to first unread message

alex...@gmail.com

unread,
Jul 16, 2008, 8:09:04 PM7/16/08
to god.rb
Hello. I'm running god on Solaris, which required a simple patch to
accommodate the different format strings that Solaris ps takes.
("pcpu" instead of "%cpu") Fortunately, as far as I can tell, the new
strings are more universal anyway. OSX ps works with either.

I've attached the git diff, in case this can be useful to anyone else,
or if it can be folded in.

Thanks! God's pretty neat.

diff --git a/lib/god/system/portable_poller.rb b/lib/god/system/
portable_poller.rb
index 95eb0e5..5321308 100644
--- a/lib/god/system/portable_poller.rb
+++ b/lib/god/system/portable_poller.rb
@@ -11,12 +11,12 @@ module God

# Percentage memory usage
def percent_memory
- ps_float('%mem')
+ ps_float('pmem')
end

# Percentage CPU usage
def percent_cpu
- ps_float('%cpu')
+ ps_float('pcpu')
end

private
@@ -39,4 +39,4 @@ module God
end
end
end
-end
\ No newline at end of file
+end
Reply all
Reply to author
Forward
0 new messages