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    


0.8.6: Config CACTI databse to easily identif custom record

 
Post new topic   Reply to topic    Cacti Forum Index -> Help: Unstable Development Versions
Author Message
Didier
Guest





PostPosted: Fri Aug 20, 2004 4:25 am    Post subject: 0.8.6: Config CACTI databse to easily identif custom record Reply with quote

New feature 0.8.6 proposed : Configure CACTI MySQL database to easily identify customed records
===============================================================================================

Hello,

Here is an improvement for Cacti 0.8.6
It has been done from cacti.sql included in cacti-0.8.6-pre20040819

The purpose is to configure the CACTI MySQL database to easily identify the customed records from those

included in the Cacti release.


By applying the procedure below
- Any record for which an primary index (id) is < 1000 ==> comes from the Cacti release
- Any record for which an primary index (id) is >= 1000 is a customed record


My other purposes to have done it :
-----------------------------------
- I've done it to be able in the future release of cacti to always start easily from a scratch release of

cacti (that may be as any software more reliable than an upgrade.
- If one day I have a problem with Cacti also start from initial release of Cacti and easily append my

company data, because the all will be identifie by INSERT INTO ... VALUES (.... with ...>=1000
I will just have to play those line and everything will be OK
- And may be later we can found further use



Applying this procedure is at your own risk, but it seems to work perfectly)
NB: This procedure won't work if more than 999 records or attempts of record creation has already been done in

a database. Before applying the procdure it may worth to make a dump at the database and quiclky look at the

records to see if you have some with an index >=999, if so don't play this trick otherwise you may loose


Now the procedure :
------------------

a) Download the files and put it in the main cacti directory
Rename it cacti_custom.sql


b) Dump your current database in case of problem

mysqldump --user=cactiuser --password=cactiuser -l --add-drop-table cacti > mysql.cacti



c) Logout cacti and quit any browser you would have on cacti


d) Play the newly downloaded cacti_custom.sql similarly to shown below

mysql --user=root --password cacti < C:\apache2\htdocs\cacti\cacti_custom.sql

Enter password: **** ---> This is the root password


That's all, it is very simple


you can now create some objects in cacti,
export the database again with mysqldump as shown above in step (a)
look at the value in thye databse you will your new entries starting with an index of 1000



Remarks
=======

a) I've played this trick only on the tables on which I was pretty sure.
Some table had already some defaut value, I haven't change them [yet] because it may require some more tests.

In the SQL file they are identified by something such as

--
-- 'host_template_snmp_query' Not modified at this time because there is a default in the primary key
--


b) The index of the old records already created are not changed, it will be just for the new one
So it may interest user that will start from scratch with Cacti



I hope this will interest many people and it will be OK for them

Didier



cacti_custom.sql.txt
 Description:

Download
 Filename:  cacti_custom.sql.txt
 Filesize:  7.52 KB
 Downloaded:  153 Time(s)

Back to top
Didier
Guest





PostPosted: Fri Aug 20, 2004 8:16 am    Post subject: New version + documentation [for 0.8.6 only] Reply with quote

For all I have made some change in in it


======= A copy of a message
Larry and Ian,

I have think a little more about the script I have written this morning.
Finally I don't think it is very risky for the databases beacuse it just create an entry then immediately remove it.

===> May be you could include them in the Download / Additonnal scripts on the WEB SITE

Here the script [I have changed it from the previous version, now it deals with all the tables except one because the index is a name not an integer
So it is unchanged

You can precise as a short description
Separate in the cacti database the original cacti database to your custom

Also I would appreciate if for the next release (including this 0.8.6 release) you don't have any entry with an index >=1000 in the cacti database
Like that we could well identify what is cacti original and what is customed.

Thanks


Didier



cacti_custom.sql.txt
 Description:

Download
 Filename:  cacti_custom.sql.txt
 Filesize:  9.23 KB
 Downloaded:  126 Time(s)


cacti_custom.readme.txt
 Description:

Download
 Filename:  cacti_custom.readme.txt
 Filesize:  3.96 KB
 Downloaded:  165 Time(s)

Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Help: Unstable Development Versions All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group