Cacti Percona Mysql plugin doesn't work properly.

Hi, there. I just installed the Percona plugins for Cacti. I followed the Percona instructions to install the PHP script and XML file into Cacti system. I created a new device to use this plugin. But, It doesn’t work properly. I attach the Log of this plugin.

05/16/2013 07:45:02 AM - CMDPHP: Poller[0] Host[2] DS[9] WARNING: Result from CMD not valid. Partial Result: MySQL: Can’t connect

What did I do wrong?

Can you help me to solve this problem, please?

Thanks in Advance.

Did you perform the section on configuring the username and password in the data pull scripts? The error looks like it is complaining about not being able to connect to a server it is trying to pull. So I’d check your config, and then check the server you are trying to monitor to make sure the username/password you specified works on it and that it allows connections from the Cacti host. Easy way to test that is to attempt to connect manually from the Cacti host to the server you are trying to monitor using the specified username and password. If that works, then it should work from Cacti if configured correctly. If that does not work, then you have an issue with your credentials.

Likely place to start is the /scripts/ss_get_mysql_stats.php file, or /scripts/ss_get_mysql_stats.php.cnf if you put them in a separate file.

Hi, Scott. Thanks for your sooner reply. I did it, but the plugin still doesn’t work. I attach a screenshot of the Preview mode section. Question:

Do I need to re start the Apache daemon?

Thanks in Advance

Jose

Did you try connecting manually from the Cacti host to the server you are attempting to monitor using the same credentials you have configured in Cacti?

Turn on more debugging in cacti to see which command is run, and then run that command from the shell. It will help find the mistake.

Apache does not need to be restarted.

Hi, there. My comments:

Scott, I couldn’t connect to the remote host using the same credentials that I configured in the PHP script. I tried using mysql commands. After I decided to monitoring mysql at localhost but I still have the same problem.

Debugging mode information.

/usr/share/cacti/site/scripts/ss_get_mysql_stats.php --host 127.0.0.1 --items ip,iq,ir,iu,ix,iz --user --pass --port , output: MySQL: Can’t connect to MySQL server on ‘127.0.0.1’ (111

Hi, gmouse, thanks for your help. I can see more info related with my problem.

I want to fix this problem. Question:

Do I need to do something specific in mysql configuration to access remotely?

Thanks in Advance.

Hi there. I just checked the Cacti log file. I found the following message:

But, Cacti still doesn’t show the Percona Mysql graphic.

Any idea?

Thanks in Advance.

If you cannot connect to the database manually using the credentials, then neither can Cacti.

From the debug message you posted, it looks like Cacti is attempting to connect with no username or password. Verify that your credentials are in /usr/share/cacti/site/scripts/ss_get_mysql_stats.php and that they are in the correct format and everything based on what the manual says.

Do not edit ss_get_*.php scripts directly.

Simply create .cnf file in the same dir, e.g. ss_get_mysql_stats.php.cnf with the content like:

<?php $mysql_user = 'user'; $mysql_pass = 'pass123';

Either way works, but the .cnf way is probably the more ideal way. You can see both options in the docs:

[url]Percona Monitoring Plugins

If you update ss_get_*.php they will get overwritten on the next update if using packages.