[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby system programs

Mohamed Hussain

9/17/2008 9:17:00 AM

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
--
Posted via http://www.ruby-....

6 Answers

Thomas Wieczorek

9/17/2008 9:58:00 AM

0

Heya!

On Wed, Sep 17, 2008 at 11:17 AM, Mohamed Hussain <pshussain@gmail.com> 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...

mockturtle

9/17/2008 10:09:00 AM

0



Mohamed Hussain ha scritto:

> 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

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_lo...).
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


> --
> Posted via http://www.ruby-....

Brian Candler

9/17/2008 10:36:00 AM

0

There is also http://snmplib.ruby...

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 (c)
you're already using SNMP for other purposes.
--
Posted via http://www.ruby-....

M. Edward (Ed) Borasky

9/17/2008 1:11:00 PM

0

On Wed, 2008-09-17 at 18:17 +0900, Mohamed Hussain wrote:
> 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?

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


Mohamed Hussain

9/17/2008 1:17:00 PM

0

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 Hussain wrote:
>> 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?
>
> 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

--
Posted via http://www.ruby-....

Brian Candler

9/17/2008 1:26:00 PM

0

> 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/...
PDF is $31.99
--
Posted via http://www.ruby-....