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
1=== modified file 'cacti/scripts/ss_get_mysql_stats.php'
2--- cacti/scripts/ss_get_mysql_stats.php 2013-07-16 08:09:44 +0000
3+++ cacti/scripts/ss_get_mysql_stats.php 2013-08-07 22:21:26 +0000
4@@ -33,6 +33,7 @@
5 $mysql_ssl = FALSE; # Whether to use SSL to connect to MySQL.
6 $mysql_ssl_key = '/etc/pki/tls/certs/mysql/client-key.pem';
7 $mysql_ssl_cert = '/etc/pki/tls/certs/mysql/client-cert.pem';
8+$mysql_ssl_ca = '/etc/pki/tls/certs/mysql/ca.pem';
9
10 $heartbeat = ''; # db.tbl if you use pt-heartbeat from Percona Toolkit.
11 $cache_dir = '/tmp'; # If set, this uses caching to avoid multiple calls.
12@@ -245,7 +246,8 @@
13 function ss_get_mysql_stats( $options ) {
14 # Process connection options and connect to MySQL.
15 global $debug, $mysql_user, $mysql_pass, $heartbeat, $cache_dir, $poll_time,
16- $chk_options, $mysql_port, $mysql_ssl, $mysql_ssl_key, $mysql_ssl_cert;
17+ $chk_options, $mysql_port, $mysql_ssl, $mysql_ssl_key, $mysql_ssl_cert,
18+ $mysql_ssl_ca;
19
20 # Connect to MySQL.
21 $user = isset($options['user']) ? $options['user'] : $mysql_user;
22@@ -263,7 +265,7 @@
23 }
24 if ( $mysql_ssl || (isset($options['mysql_ssl']) && $options['mysql_ssl']) ) {
25 $conn = mysqli_init();
26- mysqli_ssl_set($conn, $mysql_ssl_key, $mysql_ssl_cert, NULL, NULL, NULL);
27+ mysqli_ssl_set($conn, $mysql_ssl_key, $mysql_ssl_cert, $mysql_ssl_ca, NULL, NULL);
28 mysqli_real_connect($conn, $host_str, $user, $pass);
29 }
30 else {

Subscribers

People subscribed via source and target branches