Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request (with patch) - Support for Amazon RDS instances #36

Open
sfrazer opened this issue Feb 14, 2011 · 6 comments
Open

Feature request (with patch) - Support for Amazon RDS instances #36

sfrazer opened this issue Feb 14, 2011 · 6 comments

Comments

@sfrazer
Copy link

sfrazer commented Feb 14, 2011

Monitoring Amazon RDS instances with Munin and your plugin poses 2 issues:

  1. you don't get SUPER or REPLICATION CLIENT privileges in RDS
  2. you can't run munin-client on the RDS instance

I've created a patch for your excellent munin plugin that overcomes both of these limitations. It uses the creation of 2 new environment variables:

mysqlhostname - used ONLY for the config "hostname example.com" output, this doesn't obviate the requirement to put a hostname in the dsn string. This allows whatever node is running this client to present separate nodes to the Munin server. There's probably a better way to do this (one that allows a single workstation to monitor multiple RDS instances) but this was the quickest way to achieve a single RDS instance.

mysqlaws - a yes or no value that defaults to no. If set to yes, the update_master and update_slave subroutines are short-circuited.

Here's the diff against the latest version:

https://gist.github.com/825490

@kjellm
Copy link
Owner

kjellm commented May 10, 2011

Thanks for sharing. Don't know when I might have time to look at it tough :-/

@mikehaertl
Copy link

I second this issue. I get plenty of

 DBD::mysql::st execute failed: Access denied; you need (at least one of) the SUPER,REPLICATION CLIENT privilege(s) for this operation at /etc/munin/plugins/mysql_network_traffic line 980.

in my munin-node.log. I did some tests with the mysql console client and it seems that the SQL like SHOW GLOBAL STATUS runs just fine, even without SUPER permission. As i'm no Perl expert i couldn't figure out, why the SUPER permission is neccessary.

Unfortunately the patch from @sfrazer does not apply to my the plugin version i have on Ubuntu 12.04.

Any chance that we see this resolved? Or is there another workaround?

@kjellm
Copy link
Owner

kjellm commented Apr 5, 2013

The SUPER permission is not a perl thing, but a MySQL thing. It is needed for the SHOW MASTER LOGS and SHOW SLAVE STATUS queries. You can try to apply the patch below as a workaround.

diff --git a/mysql b/mysql
index 2a728d2..2cede56 100755
--- a/mysql
+++ b/mysql
@@ -362,8 +362,8 @@ sub collect_data {

     update_variables($dbh);
     update_innodb($dbh);
-    update_master($dbh);
-    update_slave($dbh);
+    #update_master($dbh);
+    #update_slave($dbh);
     update_process_list($dbh);
 }

@mikehaertl
Copy link

That works, thanks!

@grooverdan
Copy link
Contributor

the restriction on replication client may have been relaxed: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/MySQL.Procedural.Importing.External.Repl.html

@grooverdan
Copy link
Contributor

I added the following in munin-monitoring/munin/pull/386
munin-monitoring/munin@2d0d9f7
munin-monitoring/munin@e2452e5
munin-monitoring/munin@740deab

Less privs than super are required for show master status/show slave status. Could be worth adding to mysql.conf

10.0.21-MariaDB-1~jessie-log
MariaDB [(none)]> show grants;
+--------------------------------------------------------------------------------------------+
| Grants for munin@localhost                                                                 |
+--------------------------------------------------------------------------------------------+                                                       
| GRANT PROCESS, REPLICATION CLIENT ON *.* TO 'munin'@'localhost' IDENTIFIED VIA unix_socket |                                                       
+--------------------------------------------------------------------------------------------+                                                       
1 rows in set (0.00 sec)                                                                                                                             
MariaDB [(none)]> show master status;
+--------------------+----------+--------------+------------------+
| File               | Position | Binlog_Do_DB | Binlog_Ignore_DB |
+--------------------+----------+--------------+------------------+
| mariadb-bin.011145 | 46251284 |              |                  |
+--------------------+----------+--------------+------------------+
1 row in set (0.00 sec)
MariaDB [(none)]> show slave status\G
*************************** 1. row ***************************
               Slave_IO_State: Waiting for master to send event
                  Master_Host: 192.168.149.5
                  Master_User: replica
                  Master_Port: 3306

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants