Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


generic database supportb (against 0.8.7b)

 
Post new topic   Reply to topic    Cacti Forum Index -> Feature Requests
Author Message
steki



Joined: 01 Aug 2008
Posts: 3

PostPosted: Fri Aug 01, 2008 3:29 am    Post subject: generic database supportb (against 0.8.7b) Reply with quote

Honestly I didn't checked on this forum if someone has done any job done in regards of porting cacti to other databases. As this is still work in progress i'm posting here just as request for comment about code design...
I was trying not using ANY mysql-isms or pgsql-isms (nice words hehe)
so concat was emulated with adodb $GLOBALS['cnn_id']->Concat() call.
replace into calls i didn't replaced with db_replace - maybe that would be best solution but on first look too ugly and not very clean from SQL side (you don't know what is going on behind - probably I'm wrong but please comment about it)
ALL "select xx from yy limit x" and "select xx from yy limit a,b" are replaced with new additions to db functions $numrows and $offset...
ALL select x from (xx, yy) where a=b are replaced with select x from xx,yy
or if there are cross reference of tables added CROSS JOIN so it would work correctly...

will try to finish it as soon as possible.

COMMENTS PLEASE!!!!!

P.S. yes i found many references about job already done for older versions, but what a hack i like to code sometimes....
P.P.S. nope it is not funny that .diff is not allowed to be uploaded...



pg_cacti-2008-08-01-01-08.patch
 Description:
patch file against 0.8.7b

Download
 Filename:  pg_cacti-2008-08-01-01-08.patch
 Filesize:  205.95 KB
 Downloaded:  104 Time(s)

Back to top
steki



Joined: 01 Aug 2008
Posts: 3

PostPosted: Mon Aug 04, 2008 7:45 am    Post subject: Re: generic database supportb (against 0.8.7b) Reply with quote

Added hopefully usable oracle schema (work in progress).

"Problems" with cacti and oracle
adodb is usable for this task but as can be seen from bellow
Array
(
[ID] => 1
[USERNAME] => admin
[PASSWORD] => 21232f297a57a5a743894a0e4a801fc3
[REALM] => 0
[FULL_NAME] => Administrator
[MUST_CHANGE_PASSWORD] =>
[SHOW_TREE] => on
[SHOW_LIST] => on
[SHOW_PREVIEW] => on
[GRAPH_SETTINGS] => on
[LOGIN_OPTS] => 1
[POLICY_GRAPHS] => 1
[POLICY_TREES] => 1
[POLICY_HOSTS] => 1
[POLICY_GRAPH_TEMPLATES] => 1
[ENABLED] => on
)
all associated keys returned from adodb oci8 are in capital, or from pgsql - mysql
all are lowercase

Array
(
[id] => 1
[username] => admin
[password] => 21232f297a57a5a743894a0e4a801fc3
[realm] => 0
[full_name] => Administrator
[must_change_password] =>
[show_tree] => on
[show_list] => on
[show_preview] => on
[graph_settings] => on
[login_opts] => 1
[policy_graphs] => 1
[policy_trees] => 1
[policy_hosts] => 1
[policy_graph_templates] => 1
[enabled] => on
)

discussion please



cacti_oci.sql.gz
 Description:
this script can be used to create schema, users, and db object necessary for oracle to work with cacti

Download
 Filename:  cacti_oci.sql.gz
 Filesize:  33.46 KB
 Downloaded:  52 Time(s)

Back to top
steki



Joined: 01 Aug 2008
Posts: 3

PostPosted: Sun Aug 10, 2008 8:48 pm    Post subject: Re: generic database supportb (against 0.8.7b) Reply with quote

Hello,

please find attached schema generator that will generate schema for three databases
postgresql
mysql
sqlite
of course cacti does not support them but that would be a good start for any further development if you ask me (no one do but i don't care...)

anyway gen.pl is borrowed from zabbix project, and as it is GPL licensed this will not be a problem for this usage
please be aware that oracle version is not usable because few things
1. it is not create sequences and triggers (it is my plan for few next days to add it)
2. one of tables has "rows" column which is special word for oracle so it is NOT possible to use it as it is ...
3. capital letters for table names and return values for keynames in arrays returned from
db_fetch_asoc()

that is it for now ...



cacti-db.tgz
 Description:
cacti-db/Makefile (obvious...)
cacti-db/gen.pl (db generator script)
cacti-db/dumpdb.sh (db dump all data from cacti database into file with many inserts :) )
cacti-db/data.sql (extracted data with dumpdb.sh)
cacti-db/schema.sql this is main thing that ca

Download
 Filename:  cacti-db.tgz
 Filesize:  35.51 KB
 Downloaded:  47 Time(s)

Back to top
dandv



Joined: 17 Nov 2008
Posts: 1

PostPosted: Mon Nov 17, 2008 11:46 pm    Post subject: Re: generic database supportb (against 0.8.7b) Reply with quote

steki wrote:
Honestly I didn't checked on this forum if someone has done any job done in regards of porting cacti to other databases

Well, someone has, since 2007. See this thread, PostgreSQL / Generic Database - PATCH.

Back to top
TheWitness
Developer


Joined: 14 May 2002
Posts: 9736
Location: MI, USA

PostPosted: Tue Nov 18, 2008 7:13 am    Post subject: Reply with quote

As a developer, we have not implemented that patch due to the fact that not one of the key developers uses postresql, oracle, or mssql. Until that changes, it's hard for us to support these other databases.

Maybe we shouldn't worry about it working and just "hope" that the submissions by others work. Comments?

TheWitness
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Feature Requests All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group