views:

256

answers:

1

Do you know a library to access system resources for Ruby? I would like to monitor CPU, disk, RAM, network...

I would be great to have a library to monitor not only Linux, but even FreeBSD, Windows, Solaris and Mac.

+1  A: 

Monit is the one that I use. Very simple configuration (not Ruby), lots of samples on the web, etc. I'm biased towards this one because I've used it the most.

Another popular one is god. Unlike Monit it uses Ruby as the configuration language. I've never used god, but I've heard both good and bad about it. The worst being that it slowly sucks up memory. This isn't god per se, but the Ruby interpreter that you run under. Just something to keep in mind.

edit Neither of these work on Windows. I've had good luck with Monit on Linux (Ubuntu, OpenSUSE, and Fedora builds - all 2.6 kernels), Mac OS X 10.5 (never tried older), and NetBSD.

Justin Rudd
I've used both of these, but they're applications and as far as I know they don't include a library or expose an API to enable you to write your own wrapper around them.
tadman
Monit definitely isn't a library. But looking through god's sources, it is nicely factored out. I don't think it would be a huge problem to just use the pieces you were interested in.
Justin Rudd