diff --git a/USAGE.md b/USAGE.md index 6d7142c83..3fce5543e 100644 --- a/USAGE.md +++ b/USAGE.md @@ -140,4 +140,4 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with this program. If not, see <http://www.gnu.org/licenses/>. +along with this program. If not, see . diff --git a/mysqltuner.pl b/mysqltuner.pl index 0efbfa409..95601b29f 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -1230,6 +1230,9 @@ sub cve_recommendations { return; } +#$mysqlvermajor=10; +#$mysqlverminor=1; +#$mysqlvermicro=17; #prettyprint "Look for related CVE for $myvar{'version'} or lower in $opt{cvefile}"; my $cvefound = 0; open( my $fh, "<", $opt{cvefile} ) @@ -1514,8 +1517,8 @@ sub get_system_info { else { badprint "Internet : Disconnected"; } - $result{'OS'}{'NbCore'}= `nproc`; - infoprint "Number of Core CPU : ". `nproc`; + $result{'OS'}{'NbCore'} = `nproc`; + infoprint "Number of Core CPU : " . `nproc`; $result{'OS'}{'Type'} = `uname -o`; infoprint "Operating System Type : " . infocmd_one "uname -o"; $result{'OS'}{'Kernel'} = `uname -r`; @@ -2771,7 +2774,9 @@ sub mysql_stats { } # name resolution - if ( defined( $result{'Variables'}{'skip_networking'} ) && $result{'Variables'}{'skip_networking'} eq 'ON' ) { + if ( defined( $result{'Variables'}{'skip_networking'} ) + && $result{'Variables'}{'skip_networking'} eq 'ON' ) + { infoprint "Skipped name resolution test due to skip_networking=ON in system variables."; } @@ -4993,6 +4998,7 @@ sub get_wsrep_option { return '' unless scalar(@galera_options) > 0; my @memValues = grep /\s*$key =/, @galera_options; my $memValue = $memValues[0]; + return 0 unless defined $memValue; $memValue =~ s/.*=\s*(.+)$/$1/g; return $memValue; } @@ -5041,32 +5047,40 @@ sub mariadb_galera { having sum(if(c.column_key in ('PRI','UNI'), 1,0)) = 0" ); - if (get_wsrep_option('wsrep_slave_threads') > `nproc`*4 or get_wsrep_option('wsrep_slave_threads') < `nproc`*3) { - badprint "wsrep_slave_threads is not equal to 3 or 4 times number of CPU(s)"; + if ( get_wsrep_option('wsrep_slave_threads') > `nproc` * 4 + or get_wsrep_option('wsrep_slave_threads') < `nproc` * 3 ) + { + badprint + "wsrep_slave_threads is not equal to 3 or 4 times number of CPU(s)"; push @adjvars, "wsrep_slave_threads= Nb of Core CPU * 4"; - } else { - goodprint "wsrep_slave_threads is equal to 3 or 4 times number of CPU(s)"; - } + } + else { + goodprint + "wsrep_slave_threads is equal to 3 or 4 times number of CPU(s)"; + } - if (get_wsrep_option('gcs.limit') != get_wsrep_option('wsrep_slave_threads') *5 ) { + if ( get_wsrep_option('gcs.limit') != + get_wsrep_option('wsrep_slave_threads') * 5 ) + { badprint "gcs.limit should be equal to 5 * wsrep_slave_threads"; push @adjvars, "gcs.limit= wsrep_slave_threads * 5"; } else { goodprint "gcs.limit is equal to 5 * wsrep_slave_threads"; } - if (get_wsrep_option('gcs.fc_factor') == 0.8 ) { + if ( get_wsrep_option('gcs.fc_factor') == 0.8 ) { badprint "gcs.fc_factor should be equal to 0.8"; push @adjvars, "gcs.fc_factor=0.8"; } else { goodprint "gcs.limit is equal to 5 * wsrep_slave_threads"; } - if (get_wsrep_option('wsrep_flow_control_paused') > 0.02) { + if ( get_wsrep_option('wsrep_flow_control_paused') > 0.02 ) { badprint "Fraction of time node pause flow control > 0.02"; } else { - goodprint "Flow control fraction seems to be OK (wsrep_flow_control_paused<=0.02)"; + goodprint +"Flow control fraction seems to be OK (wsrep_flow_control_paused<=0.02)"; } if ( scalar(@primaryKeysNbTables) > 0 ) { badprint "Following table(s) don't have primary key:";