[collectd] Fwd: [5.1] Multiple mysql instances?

2013-03-18 Thread Jacek Osiecki
Hello,

I'm trying to set up again collectd to handle more than one mysql instance per 
host.
The problem is, that there is no information on how to do this - anywhere...

When I start collectd, I get the warning:

The read function mysql-mysql is already registered. Check for duplicate 
LoadPlugin lines in your configuration!

However, the only place where I handle mysql is /etc/collectd.d/mysql.conf:

LoadPlugin mysql
Plugin mysql
Database sqlone
User backup
Password 
Host 192.168.0.21
Database mysql
#Socket /var/lib/mysql/sc-sqlcrit/mysql.sock
/Database
Database sqltwo
User backup2
Password 
Database mysql
Host 192.168.0.22
#Socket /var/lib/mysql/sc-sqlmain/mysql.sock
/Database
/Plugin

I tried many combinations: using Host in first database and Socket in 
second one, using
different users - nothing helped. Always only the first database is handled.

Am I doing something wrong, or is collectd simply unable to handle two (or 
more) mysql servers?

Greetings,
-- 
Jacek Osiecki
josie...@silvercube.pl

Silvercube s.c.
ul. Makuszynskiego 4
31-752 Kraków
+48 (12) 684 21 00



___
collectd mailing list
collectd@verplant.org
http://mailman.verplant.org/listinfo/collectd


Re: [collectd] Fwd: [5.1] Multiple mysql instances?

2013-03-18 Thread Fabien Wernli
Hi Jacek,

On Mon, Mar 18, 2013 at 09:37:22AM +0100, Jacek Osiecki wrote:
 LoadPlugin mysql
 Plugin mysql
   Database sqlone
   User backup
   Password 
   Host 192.168.0.21
   Database mysql
   #Socket /var/lib/mysql/sc-sqlcrit/mysql.sock
   /Database
   Database sqltwo
   User backup2
   Password 
   Database mysql
   Host 192.168.0.22
   #Socket /var/lib/mysql/sc-sqlmain/mysql.sock
   /Database
 /Plugin
 
 I tried many combinations: using Host in first database and Socket in 
 second one, using
 different users - nothing helped. Always only the first database is handled.
 
 Am I doing something wrong, or is collectd simply unable to handle two (or 
 more) mysql servers?

I think the 'Database' directive *in* the block overrides the name in the 
'Database'
*definition*. This means that in your example, `sqlone` and `sqltwo` are
both being overridden by `mysql`, thus yielding the error message. I
remember banging my head on a hard surface too when trying to achieve the
same goal.

If I were you, I'd simply drop the `Database mysql` from your
example, and it should work as-is.


___
collectd mailing list
collectd@verplant.org
http://mailman.verplant.org/listinfo/collectd


Re: [collectd] Fwd: [5.1] Multiple mysql instances?

2013-03-18 Thread Sebastian Harl
Hi,

On Mon, Mar 18, 2013 at 11:12:24AM +0100, Fabien Wernli wrote:
 On Mon, Mar 18, 2013 at 09:37:22AM +0100, Jacek Osiecki wrote:
  LoadPlugin mysql
  Plugin mysql
  Database sqlone
  User backup
  Password 
  Host 192.168.0.21
  Database mysql
  #Socket /var/lib/mysql/sc-sqlcrit/mysql.sock
  /Database
  Database sqltwo
  User backup2
  Password 
  Database mysql
  Host 192.168.0.22
  #Socket /var/lib/mysql/sc-sqlmain/mysql.sock
  /Database
  /Plugin
  
  I tried many combinations: using Host in first database and Socket in 
  second one, using
  different users - nothing helped. Always only the first database is handled.
  
  Am I doing something wrong, or is collectd simply unable to handle two (or 
  more) mysql servers?
 
 I think the 'Database' directive *in* the block overrides the name in the 
 'Database'
 *definition*. This means that in your example, `sqlone` and `sqltwo` are
 both being overridden by `mysql`, thus yielding the error message. I
 remember banging my head on a hard surface too when trying to achieve the
 same goal.

This issue should have been fixed in 5.1.1. The name of the Database
definition is now used when registering the callback. The above
configuration is perfectly fine in that case.

 If I were you, I'd simply drop the `Database mysql` from your
 example, and it should work as-is.

No, this will only make the plugin not connect to any specific database.
Before 5.1.1, you'd have to specify *different* database names (using
the Database option within the Database block) in order to make
this work.

HTH,
Sebastian

-- 
Sebastian tokkee Harl +++ GnuPG-ID: 0x8501C7FC +++ http://tokkee.org/

Those who would give up Essential Liberty to purchase a little Temporary
Safety, deserve neither Liberty nor Safety. -- Benjamin Franklin



signature.asc
Description: Digital signature
___
collectd mailing list
collectd@verplant.org
http://mailman.verplant.org/listinfo/collectd