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

Fabien Wernli collectd at faxm0dem.org
Mon Mar 18 11:12:24 CET 2013


Hi Jacek,

On Mon, Mar 18, 2013 at 09:37:22AM +0100, Jacek Osiecki wrote:
> LoadPlugin mysql
> <Plugin mysql>
> 	<Database "sqlone">
> 		User "backup"
> 		Password "xxxx"
> 		Host "192.168.0.21"
> 		Database "mysql"
> 		#Socket "/var/lib/mysql/sc-sqlcrit/mysql.sock"
> 	</Database>
> 	<Database "sqltwo">
> 		User "backup2"
> 		Password "yyyy"
> 		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.




More information about the collectd mailing list