Merge lp:~mischa-ter-smitten/percona-monitoring-plugins/percona-monitoring-plugins into lp:percona-monitoring-plugins/1.0

Proposed by Mischa ter Smitten
Status: Merged
Merge reported by: Roman Vynar
Merged at revision: not available
Proposed branch: lp:~mischa-ter-smitten/percona-monitoring-plugins/percona-monitoring-plugins
Merge into: lp:percona-monitoring-plugins/1.0
Diff against target: 30 lines (+4/-2)
1 file modified
cacti/scripts/ss_get_mysql_stats.php (+4/-2)
To merge this branch: bzr merge lp:~mischa-ter-smitten/percona-monitoring-plugins/percona-monitoring-plugins
Reviewer Review Type Date Requested Status
Roman Vynar Approve
Review via email: mp+179059@code.launchpad.net

Description of the change

I added a MySQL SSL CA file option to make monitoring over SSL more configurable (and let it work for me).

To post a comment you must log in.
Revision history for this message
Roman Vynar (roman-vynar) :
review: Approve
Revision history for this message
Mischa ter Smitten (mischa-ter-smitten) wrote :

Thanks

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'cacti/scripts/ss_get_mysql_stats.php'
--- cacti/scripts/ss_get_mysql_stats.php 2013-07-16 08:09:44 +0000
+++ cacti/scripts/ss_get_mysql_stats.php 2013-08-07 22:21:26 +0000
@@ -33,6 +33,7 @@
33$mysql_ssl = FALSE; # Whether to use SSL to connect to MySQL.33$mysql_ssl = FALSE; # Whether to use SSL to connect to MySQL.
34$mysql_ssl_key = '/etc/pki/tls/certs/mysql/client-key.pem';34$mysql_ssl_key = '/etc/pki/tls/certs/mysql/client-key.pem';
35$mysql_ssl_cert = '/etc/pki/tls/certs/mysql/client-cert.pem';35$mysql_ssl_cert = '/etc/pki/tls/certs/mysql/client-cert.pem';
36$mysql_ssl_ca = '/etc/pki/tls/certs/mysql/ca.pem';
3637
37$heartbeat = ''; # db.tbl if you use pt-heartbeat from Percona Toolkit.38$heartbeat = ''; # db.tbl if you use pt-heartbeat from Percona Toolkit.
38$cache_dir = '/tmp'; # If set, this uses caching to avoid multiple calls.39$cache_dir = '/tmp'; # If set, this uses caching to avoid multiple calls.
@@ -245,7 +246,8 @@
245function ss_get_mysql_stats( $options ) {246function ss_get_mysql_stats( $options ) {
246 # Process connection options and connect to MySQL.247 # Process connection options and connect to MySQL.
247 global $debug, $mysql_user, $mysql_pass, $heartbeat, $cache_dir, $poll_time,248 global $debug, $mysql_user, $mysql_pass, $heartbeat, $cache_dir, $poll_time,
248 $chk_options, $mysql_port, $mysql_ssl, $mysql_ssl_key, $mysql_ssl_cert;249 $chk_options, $mysql_port, $mysql_ssl, $mysql_ssl_key, $mysql_ssl_cert,
250 $mysql_ssl_ca;
249251
250 # Connect to MySQL.252 # Connect to MySQL.
251 $user = isset($options['user']) ? $options['user'] : $mysql_user;253 $user = isset($options['user']) ? $options['user'] : $mysql_user;
@@ -263,7 +265,7 @@
263 }265 }
264 if ( $mysql_ssl || (isset($options['mysql_ssl']) && $options['mysql_ssl']) ) {266 if ( $mysql_ssl || (isset($options['mysql_ssl']) && $options['mysql_ssl']) ) {
265 $conn = mysqli_init();267 $conn = mysqli_init();
266 mysqli_ssl_set($conn, $mysql_ssl_key, $mysql_ssl_cert, NULL, NULL, NULL);268 mysqli_ssl_set($conn, $mysql_ssl_key, $mysql_ssl_cert, $mysql_ssl_ca, NULL, NULL);
267 mysqli_real_connect($conn, $host_str, $user, $pass);269 mysqli_real_connect($conn, $host_str, $user, $pass);
268 }270 }
269 else {271 else {

Subscribers

People subscribed via source and target branches