RE: Gathering CPU info from Linux and FreeBSD and placing it into aMySQL db

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Nate,

We are a hosting company.  We use this Mambo-like CMS called CATS, which
pretty much tells us what company owns what server(s) in our data
centers.  CATS will provide us with a list of details on the specs for
each machine they own, which include the specs I listed (memory, # of
cpus, etc.)  Someone in our company deleted the table within the MySQL
db that listed our 400+ machines.  Since IT is slammed with other tasks,
they have assigned me to this job.  

This is a step by step as to what I've decided needs to happen, in order
for this task to operate (somewhat) smoothly.  

1) Read IP addresses from a tab-delimited file, which will follow the
format:

abc.com		64.64.64.1
domain.com	255.213.6.4
blah.co.uk	29.42.200.9
etc.net		13.14.15.255

2) Assign the $domain variable to the domain name in each line, then
assign $ipaddress to the actual ip address

3) Take $ipaddress and ssh into each box (we have a private/public ssh
key set up)

4) (This is the undecided step) Run script to gather the necessary
server information and export info into either a)CSV or b)XML

5) Take exported file and upload it/email it to my box/my email address

6) Take exported file and create a script to import the information into
the CATS MySQL db (not handled by me, but I can easily take over
responsibility on creating this script and implement it into my code)

7) Lather, rinse, repeat :)


Hope this helps to clear up some information.  I got more answers to any
questions anyone might have.  Thanks again :)

Patrick








On Wed, 2005-08-10 at 16:41 -0400, Nathan Tobik wrote:
> Can I ask why you are trying to write a script that from what I
> understand goes to each box to retrieve the data instead of pushing the
> data to the central db?  
> 
> You could write a little script in PHP that gathers the required
> information and then does an insert into your database.  Then from the
> database you can create a webpage that is a view of all of your
> machines.  On the local machine you can schedule your script to run
> every X minutes via crontab.
> 
> If I misread your email and headed down the wrong path please let me
> know.
> 
> Nate Tobik
> (412)661-5700 x206
> VigilantMinds
> 
> 
> 
> <snip...>
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux