Ruby system programs

Hai all,
Hope everybody fine.
But
I am not fine,because I got one assignment from my project head.

The problem is :-

  1. To find the Memory usage
  2. To find the CPU usage
  3. To find the UPTIME Status
  4. To find the Hard Disk space(used/available)
  5. To find the status of Service running (like MYSQL)

I would like to know,how to write program.
Is there any way to find all the information above mentioned using Ruby?
If yes,Please let me know
Thanks advance
Regards
Hussain

Heya!

On Wed, Sep 17, 2008 at 11:17 AM, Mohamed H. [email protected]
wrote:

  1. To find the Memory usage
  2. To find the CPU usage
  3. To find the UPTIME Status
  4. To find the Hard Disk space(used/available)
  5. To find the status of Service running (like MYSQL)

Try http://rubyforge.org/projects/sysutils/

Mohamed H. ha scritto:

  1. To find the Hard Disk space(used/available)
  2. To find the status of Service running (like MYSQL)

I would like to know,how to write program.
Is there any way to find all the information above mentioned using Ruby?
If yes,Please let me know

You do not specify the OS you are working with (Windows, Linux, …).
If you are in Linux,
I guess you can find those informations in some pseudo-files under
the /proc
filesystem (e.g. /proc/loadavg -->
http://www.linuxinsight.com/proc_loadavg.html).
If you are working with other OSes, maybe you can call (with popen)
some external
utility which reports those informations and parse its output.

Thanks advance
Regards
Hussain

On Wed, 2008-09-17 at 18:17 +0900, Mohamed H. wrote:

  1. To find the Hard Disk space(used/available)
  2. To find the status of Service running (like MYSQL)

I would like to know,how to write program.
Is there any way to find all the information above mentioned using Ruby?

Yes, but it is operating-system dependent. For most flavors of Unix,
including Linux, pick up the second edition of the “Swordfish Book”,
(System Performance Tuning, 2nd Edition O’Reilly System Administration).
All the command line tools are documented there – just write Ruby
scripts to run them and parse the output.

Similar tools exist for Windows, but I don’t have a book I can
recommend.

M. Edward (Ed) Borasky
ruby-perspectives.blogspot.com

“A mathematician is a machine for turning coffee into theorems.” –
Alfréd Rényi via Paul Erdős

There is also http://snmplib.rubyforge.org/

Of course you need to run SNMP agents on the platform(s) you wish to
monitor, but then you can use snmplib to query them.

This may be a good approach if (a) you have lots of remote hosts to
monitor, (b) you have a mixture of different types of hosts, and/or ©
you’re already using SNMP for other purposes.

Dear Edward,
Do you have System Performance Tuning, 2nd Edition O’Reilly System
Administration book in ebook format? or Where can i find that book?
Regards
Hussain
M. Edward (Ed) Borasky wrote:

On Wed, 2008-09-17 at 18:17 +0900, Mohamed H. wrote:

  1. To find the Hard Disk space(used/available)
  2. To find the status of Service running (like MYSQL)

I would like to know,how to write program.
Is there any way to find all the information above mentioned using Ruby?

Yes, but it is operating-system dependent. For most flavors of Unix,
including Linux, pick up the second edition of the “Swordfish Book”,
(System Performance Tuning, 2nd Edition O’Reilly System Administration).
All the command line tools are documented there – just write Ruby
scripts to run them and parse the output.

Similar tools exist for Windows, but I don’t have a book I can
recommend.

M. Edward (Ed) Borasky
ruby-perspectives.blogspot.com

“A mathematician is a machine for turning coffee into theorems.” –
Alfréd Rényi via Paul Erdős

Do you have System Performance Tuning, 2nd Edition O’Reilly System
Administration book in ebook format? or Where can i find that book?

Google is your friend.
http://oreilly.com/catalog/9780596002848/index.html
PDF is $31.99