Hello Piotr, Oops, you found a bug!
I've seen the code that handles multiple MySQL connections and I can confirm it has a bug accounting the next array entry. This will be fixed in the next Monitorix release (probably 2.5.1 as this is an urgent fix). Until there, and as a work-around you may want to apply the following patch: --- /usr/bin/monitorix 2012-03-21 16:16:12.000000000 +0100 +++ monitorix 2012-03-26 12:53:23.000000000 +0200 @@ -4280,12 +4280,12 @@ $print_error = 1; } - foreach(@MYSQL_HOST_LIST) { - my $host = $_; + for($n = 0; $n < scalar(@MYSQL_HOST_LIST); $n++) { + my $host = $MYSQL_HOST_LIST[$n]; my $port = $MYSQL_PORT_LIST[$n]; my $user = $MYSQL_USER_LIST[$n]; my $pass = $MYSQL_PASS_LIST[$n]; - unless ($_ && $port && $user && $pass) { + unless ($host && $port && $user && $pass) { logger("$myself: ERROR: invalid or not defined configuration."); next; } Just save this patch into a file called like 'monitorix.patch' and patch your current Monitorix 2.5.0 installation with: # patch /usr/bin/monitorix < monitorix.patch Many thanks. Best regards. On 03/25/2012 08:36 PM, Piotr Smalira wrote: > Hello Jordi! > > I have problem with graph more than one MySQL server: > > If I define one MySQL Server in monitorix.conf, it works well, but when > I add second one, I cant see charts from both of them. > > Logs tell me: > > main::mysql_update: Cannot connect to MySQL > 'sql-server_name2.mydomain.com:3306'. > ERROR: while updating /var/lib/monitorix/mysql.rrd: > /var/lib/monitorix/mysql.rrd: expected 76 data source readings (got 38) > from N > > I can connect to my server manually without problem. > > -- > Z poważaniem / Best Regards, > > Piotr Smalira > Administrator systemów IT Gimnazjum nr 16 w Lublinie > IT Administrator of Gimnasium no 16 in Lublin > -- Jordi Sanfeliu FIBRANET Network Services Provider http://www.fibranet.cat ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure _______________________________________________ Monitorix-general mailing list Monitorix-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monitorix-general