# Cacti Percona Mysql plugin doesn't work properly.

**URL:** <https://forums.percona.com/t/cacti-percona-mysql-plugin-doesnt-work-properly/2688>\
**Category:** Percona Monitoring Plugins\
**Created:** [May 16, 2013, 11:55am UTC](https://forums.percona.com/t/cacti-percona-mysql-plugin-doesnt-work-properly/2688 "2013-05-16T11:55:33Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![josem](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@josem](https://forums.percona.com/u/josem)\
**Post date:** [May 16, 2013, 11:55am UTC](https://forums.percona.com/t/cacti-percona-mysql-plugin-doesnt-work-properly/2688/1 "2013-05-16T11:55:33Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![scott.nemes](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/scott.nemes/32/5_2.png) [@scott.nemes](https://forums.percona.com/u/scott.nemes)\
**Post date:** [May 16, 2013, 12:38pm UTC](https://forums.percona.com/t/cacti-percona-mysql-plugin-doesnt-work-properly/2688/2 "2013-05-16T12:38:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![josem](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@josem](https://forums.percona.com/u/josem)\
**Post date:** [May 16, 2013, 1:50pm UTC](https://forums.percona.com/t/cacti-percona-mysql-plugin-doesnt-work-properly/2688/3 "2013-05-16T13:50:32Z")

</div>

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

 ![photoid=10190|attachment](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/0/01c782c614128f72e31a09cc9580a371ab1e804a.jpeg)

---

<div class="post-metadata">

**Author:** ![scott.nemes](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/scott.nemes/32/5_2.png) [@scott.nemes](https://forums.percona.com/u/scott.nemes)\
**Post date:** [May 16, 2013, 2:27pm UTC](https://forums.percona.com/t/cacti-percona-mysql-plugin-doesnt-work-properly/2688/4 "2013-05-16T14:27:38Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![gmouse](https://avatars.discourse-cdn.com/v4/letter/g/b9e5f3/32.png) [@gmouse](https://forums.percona.com/u/gmouse)\
**Post date:** [May 16, 2013, 4:55pm UTC](https://forums.percona.com/t/cacti-percona-mysql-plugin-doesnt-work-properly/2688/5 "2013-05-16T16:55:45Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![josem](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@josem](https://forums.percona.com/u/josem)\
**Post date:** [May 17, 2013, 8:28am UTC](https://forums.percona.com/t/cacti-percona-mysql-plugin-doesnt-work-properly/2688/6 "2013-05-17T08:28:23Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![josem](https://avatars.discourse-cdn.com/v4/letter/j/5fc32e/32.png) [@josem](https://forums.percona.com/u/josem)\
**Post date:** [May 17, 2013, 12:07pm UTC](https://forums.percona.com/t/cacti-percona-mysql-plugin-doesnt-work-properly/2688/7 "2013-05-17T12:07:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![scott.nemes](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/scott.nemes/32/5_2.png) [@scott.nemes](https://forums.percona.com/u/scott.nemes)\
**Post date:** [May 17, 2013, 12:33pm UTC](https://forums.percona.com/t/cacti-percona-mysql-plugin-doesnt-work-properly/2688/8 "2013-05-17T12:33:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![weber](https://avatars.discourse-cdn.com/v4/letter/w/da6949/32.png) [@weber](https://forums.percona.com/u/weber)\
**Post date:** [May 17, 2013, 1:05pm UTC](https://forums.percona.com/t/cacti-percona-mysql-plugin-doesnt-work-properly/2688/9 "2013-05-17T13:05:28Z")

</div>

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';

---

<div class="post-metadata">

**Author:** ![scott.nemes](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/scott.nemes/32/5_2.png) [@scott.nemes](https://forums.percona.com/u/scott.nemes)\
**Post date:** [May 17, 2013, 3:24pm UTC](https://forums.percona.com/t/cacti-percona-mysql-plugin-doesnt-work-properly/2688/10 "2013-05-17T15:24:49Z")

</div>

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](http://www.percona.com/doc/percona-monitoring-plugins/cacti/installing-templates.html%5B/url%5D)

---

<div class="post-metadata">

**Author:** ![weber](https://avatars.discourse-cdn.com/v4/letter/w/da6949/32.png) [@weber](https://forums.percona.com/u/weber)\
**Post date:** [May 25, 2013, 4:22am UTC](https://forums.percona.com/t/cacti-percona-mysql-plugin-doesnt-work-properly/2688/11 "2013-05-25T04:22:49Z")

</div>

If you update ss\_get\_\*.php they will get overwritten on the next update if using packages.
