[racktables-users] Re: DB structure

  • From: Denis Ovsienko <infrastation@xxxxxxxxx>
  • To: "racktables-users@xxxxxxxxxxxxx" <racktables-users@xxxxxxxxxxxxx>
  • Date: Sun, 10 Feb 2013 16:09:09 +0400

[...]
> Like I said, I'm dense...   I don't see any chance of being able to
> succeed at decoding php that is accessing an undocumented db, and
> especially not without understanding the underlying sql.   But if I
> understood the sql I probably wouldn't need an api to copy back and
> forth to a different db where I could access it with tools like jasper
> reports, etc.

Yes, RackTables database schema is undocumented, in that there are no 
supplementary notes behind the tables and relations, but the schema itself is 
open. For example, you can issue a "SHOW CREATE TABLE Object" against the live 
database and compare the output to the contents of install.php of respective 
release. The excerpts should normally be the same.

As it was said before, there are few (navigation.php and index.php to start 
with) core .php files pulling the rest of RackTables together, likewise, there 
are few core tables in the database. If you want to see the relations between 
the tables, in the first place study the foreign keys, but keep in mind there 
may be other constraints or format translations implemented at PHP source code 
level. That's why using the PHP functions is just safer and saves the time.

Most important, it doesn't require to be a PHP or SQL expert to begin studying 
RackTables, and if you come across particular tricky points, there are people 
on this mailing list to ask (somehow the scripts in the contribs repository 
were written after all). Documenting all the source code and database at once 
is impossible, but if you figure it out which pieces should be added first 
(better, write them), RackTables may become more friendly for starters.

Hope that helps.


[...]
>>>  I was sort of hoping I could get them grouped into locations/racks
>>>  (which I have for most things), and then use the racktables web
>>>  interface to adjust the positioning of items in a rack when there is
>>>  time for a physical audit of a rack at a time.
>>  There's the "zero-unit" mounting slot which is purposed exactly for this, 
>> is it assignable through this API?
>
> Thanks - that sounds promising.  What about power connections to PDU's
> where I have some identifier but no concept of location?

I never did power lines accounting myself and don't even know how far 
RackTables is from the most basic way of doing that. There are other users 
interested in exactly that, however.

-- 
    Denis Ovsienko

Other related posts: