Comment 3 for bug 908453

Revision history for this message
Clint Byrum (clint-fewbar) wrote : Re: Cacti - My first charm

Hello zivley, welcome! And thanks for working on cacti, its a pretty cool platform. :)

I was taking a look at your charm, and I think you may have been confused by the way relations work.

It looks like you copied the mysql charm's db-relation-joined. This is not really the way that charms work. That bit of work is done inside the mysql charm, and your charm doesn't need to express any of those details. What it needs to do is simply receive the user/password/host/dbname of the mysql server in db-relation-changed, and then place those things in the local cacti configuration file so that cacti can access the database.

One thing to watch out for, it looks like cacti depends on dbconfig-common. This is the package that pops up interactive screens to ask you for database connection info. The simplest way to handle this is probably to disable it with debconf before the apt-get install:

debconf-set-selections <<<EOF
cacti cacti/dbconfig-install boolean false
EOF

That will allow you to generate the cacti config yourself.