Update Vulnerabilities list
Indenting mysqltuner Update Usage information
This commit is contained in:
parent
4a4629f862
commit
ba21312e00
1 changed files with 93 additions and 75 deletions
|
@ -1359,7 +1359,8 @@ sub log_file_recommendations {
|
||||||
|
|
||||||
subheaderprint "Log file Recommendations";
|
subheaderprint "Log file Recommendations";
|
||||||
if ( "$myvar{'log_error'}" eq "stderr" ) {
|
if ( "$myvar{'log_error'}" eq "stderr" ) {
|
||||||
badprint "log_error is set to $myvar{'log_error'}, but this script can't read stderr";
|
badprint
|
||||||
|
"log_error is set to $myvar{'log_error'}, but this script can't read stderr";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
elsif ( $myvar{'log_error'} =~ /^(docker|podman|kubectl):(.*)/ ) {
|
elsif ( $myvar{'log_error'} =~ /^(docker|podman|kubectl):(.*)/ ) {
|
||||||
|
@ -1945,21 +1946,25 @@ sub security_recommendations {
|
||||||
debugprint "Password column = $PASS_COLUMN_NAME";
|
debugprint "Password column = $PASS_COLUMN_NAME";
|
||||||
|
|
||||||
# IS THERE A ROLE COLUMN
|
# IS THERE A ROLE COLUMN
|
||||||
my $is_role_column = select_one "select count(*) from information_schema.columns where TABLE_NAME='user' AND TABLE_SCHEMA='mysql' and COLUMN_NAME='IS_ROLE'";
|
my $is_role_column = select_one
|
||||||
|
"select count(*) from information_schema.columns where TABLE_NAME='user' AND TABLE_SCHEMA='mysql' and COLUMN_NAME='IS_ROLE'";
|
||||||
|
|
||||||
my $extra_user_condition = "";
|
my $extra_user_condition = "";
|
||||||
$extra_user_condition = "IS_ROLE = 'N' AND" if $is_role_column > 0;
|
$extra_user_condition = "IS_ROLE = 'N' AND" if $is_role_column > 0;
|
||||||
my @mysqlstatlist;
|
my @mysqlstatlist;
|
||||||
if ( $is_role_column > 0 ) {
|
if ( $is_role_column > 0 ) {
|
||||||
@mysqlstatlist= select_array "SELECT CONCAT(QUOTE(user), '\@', QUOTE(host)) FROM mysql.user WHERE IS_ROLE='Y'";
|
@mysqlstatlist = select_array
|
||||||
|
"SELECT CONCAT(QUOTE(user), '\@', QUOTE(host)) FROM mysql.user WHERE IS_ROLE='Y'";
|
||||||
foreach my $line ( sort @mysqlstatlist ) {
|
foreach my $line ( sort @mysqlstatlist ) {
|
||||||
chomp($line);
|
chomp($line);
|
||||||
infoprint "User $line is User Role";
|
infoprint "User $line is User Role";
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
debugprint "No Role user detected";
|
debugprint "No Role user detected";
|
||||||
goodprint "No Role user detected";
|
goodprint "No Role user detected";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Looking for Anonymous users
|
# Looking for Anonymous users
|
||||||
@mysqlstatlist = select_array
|
@mysqlstatlist = select_array
|
||||||
"SELECT CONCAT(QUOTE(user), '\@', QUOTE(host)) FROM mysql.user WHERE $extra_user_condition (TRIM(USER) = '' OR USER IS NULL)";
|
"SELECT CONCAT(QUOTE(user), '\@', QUOTE(host)) FROM mysql.user WHERE $extra_user_condition (TRIM(USER) = '' OR USER IS NULL)";
|
||||||
|
@ -2135,14 +2140,22 @@ sub get_replication_status {
|
||||||
|
|
||||||
infoprint "Semi synchronous replication Master: "
|
infoprint "Semi synchronous replication Master: "
|
||||||
. (
|
. (
|
||||||
( defined( $myvar{'rpl_semi_sync_master_enabled'} ) or defined( $myvar{'rpl_semi_sync_source_enabled'} ) )
|
(
|
||||||
? ( $myvar{'rpl_semi_sync_master_enabled'} // $myvar{'rpl_semi_sync_source_enabled'} )
|
defined( $myvar{'rpl_semi_sync_master_enabled'} )
|
||||||
|
or defined( $myvar{'rpl_semi_sync_source_enabled'} )
|
||||||
|
)
|
||||||
|
? ( $myvar{'rpl_semi_sync_master_enabled'}
|
||||||
|
// $myvar{'rpl_semi_sync_source_enabled'} )
|
||||||
: 'Not Activated'
|
: 'Not Activated'
|
||||||
);
|
);
|
||||||
infoprint "Semi synchronous replication Slave: "
|
infoprint "Semi synchronous replication Slave: "
|
||||||
. (
|
. (
|
||||||
( defined( $myvar{'rpl_semi_sync_slave_enabled'} ) or defined( $myvar{'rpl_semi_sync_replica_enabled'} ) )
|
(
|
||||||
? ( $myvar{'rpl_semi_sync_slave_enabled'} // $myvar{'rpl_semi_sync_replica_enabled'} )
|
defined( $myvar{'rpl_semi_sync_slave_enabled'} )
|
||||||
|
or defined( $myvar{'rpl_semi_sync_replica_enabled'} )
|
||||||
|
)
|
||||||
|
? ( $myvar{'rpl_semi_sync_slave_enabled'}
|
||||||
|
// $myvar{'rpl_semi_sync_replica_enabled'} )
|
||||||
: 'Not Activated'
|
: 'Not Activated'
|
||||||
);
|
);
|
||||||
if ( scalar( keys %myrepl ) == 0 and scalar( keys %myslaves ) == 0 ) {
|
if ( scalar( keys %myrepl ) == 0 and scalar( keys %myslaves ) == 0 ) {
|
||||||
|
@ -2156,13 +2169,15 @@ sub get_replication_status {
|
||||||
}
|
}
|
||||||
|
|
||||||
$result{'Replication'}{'status'} = \%myrepl;
|
$result{'Replication'}{'status'} = \%myrepl;
|
||||||
my ($io_running) = $myrepl{'Slave_IO_Running'} // $myrepl{'Replica_IO_Running'};
|
my ($io_running) = $myrepl{'Slave_IO_Running'}
|
||||||
|
// $myrepl{'Replica_IO_Running'};
|
||||||
debugprint "IO RUNNING: $io_running ";
|
debugprint "IO RUNNING: $io_running ";
|
||||||
my ($sql_running) = $myrepl{'Slave_SQL_Running'} // $myrepl{'Replica_SQL_Running'};
|
my ($sql_running) = $myrepl{'Slave_SQL_Running'}
|
||||||
|
// $myrepl{'Replica_SQL_Running'};
|
||||||
debugprint "SQL RUNNING: $sql_running ";
|
debugprint "SQL RUNNING: $sql_running ";
|
||||||
|
|
||||||
|
my ($seconds_behind_master) = $myrepl{'Seconds_Behind_Master'}
|
||||||
my ($seconds_behind_master) = $myrepl{'Seconds_Behind_Master'} // $myrepl{'Seconds_Behind_Source'} ;
|
// $myrepl{'Seconds_Behind_Source'};
|
||||||
$seconds_behind_master = 1000000 unless defined($seconds_behind_master);
|
$seconds_behind_master = 1000000 unless defined($seconds_behind_master);
|
||||||
debugprint "SECONDS : $seconds_behind_master ";
|
debugprint "SECONDS : $seconds_behind_master ";
|
||||||
|
|
||||||
|
@ -2209,18 +2224,20 @@ sub validate_mysql_version {
|
||||||
or mysql_version_eq( 10, 5 )
|
or mysql_version_eq( 10, 5 )
|
||||||
or mysql_version_eq( 10, 6 )
|
or mysql_version_eq( 10, 6 )
|
||||||
or mysql_version_eq( 10, 7 )
|
or mysql_version_eq( 10, 7 )
|
||||||
or mysql_version_eq( 10, 8 )
|
or mysql_version_eq( 10, 8 ) )
|
||||||
)
|
|
||||||
{
|
{
|
||||||
goodprint "Currently running supported MySQL version "
|
goodprint "Currently running supported MySQL version "
|
||||||
. $myvar{'version'} . "";
|
. $myvar{'version'} . "";
|
||||||
return;
|
return;
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
badprint "Your MySQL version "
|
badprint "Your MySQL version "
|
||||||
. $myvar{'version'}
|
. $myvar{'version'}
|
||||||
. " is EOL software! Upgrade soon!";
|
. " is EOL software! Upgrade soon!";
|
||||||
push ( @generalrec, "You are using n unsupported version for production environments");
|
push( @generalrec,
|
||||||
push ( @generalrec, "Upgrade as soon as possible to a supported version !");
|
"You are using n unsupported version for production environments" );
|
||||||
|
push( @generalrec,
|
||||||
|
"Upgrade as soon as possible to a supported version !" );
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3188,6 +3205,7 @@ sub mysql_stats {
|
||||||
infoprint
|
infoprint
|
||||||
"Skipped name resolution test due to missing skip_name_resolve in system variables.";
|
"Skipped name resolution test due to missing skip_name_resolve in system variables.";
|
||||||
}
|
}
|
||||||
|
|
||||||
#Cpanel and Skip name resolve
|
#Cpanel and Skip name resolve
|
||||||
elsif ( -r "/usr/local/cpanel/cpanel" ) {
|
elsif ( -r "/usr/local/cpanel/cpanel" ) {
|
||||||
if ( $result{'Variables'}{'skip_name_resolve'} ne 'OFF' ) {
|
if ( $result{'Variables'}{'skip_name_resolve'} ne 'OFF' ) {
|
||||||
|
@ -3195,7 +3213,9 @@ sub mysql_stats {
|
||||||
}
|
}
|
||||||
if ( $result{'Variables'}{'skip_name_resolve'} eq 'OFF' ) {
|
if ( $result{'Variables'}{'skip_name_resolve'} eq 'OFF' ) {
|
||||||
badprint "CPanel and Flex system skip-name-resolve should be on";
|
badprint "CPanel and Flex system skip-name-resolve should be on";
|
||||||
push (@generalrec, "name resolution is enabled due to cPanel doesn't support this disabled.");
|
push( @generalrec,
|
||||||
|
"name resolution is enabled due to cPanel doesn't support this disabled."
|
||||||
|
);
|
||||||
push( @adjvars, "skip-name-resolve=0" );
|
push( @adjvars, "skip-name-resolve=0" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3622,13 +3642,13 @@ sub mysql_myisam {
|
||||||
infoprint "MyISAM Metrics are disabled on last MySQL versions.";
|
infoprint "MyISAM Metrics are disabled on last MySQL versions.";
|
||||||
if ( $myvar{'key_buffer_size'} > 0 ) {
|
if ( $myvar{'key_buffer_size'} > 0 ) {
|
||||||
push( @adjvars, "key_buffer_size=0" );
|
push( @adjvars, "key_buffer_size=0" );
|
||||||
push( @generalrec, "Buffer Key MyISAM set to 0, no MyISAM table detected" );
|
push( @generalrec,
|
||||||
|
"Buffer Key MyISAM set to 0, no MyISAM table detected" );
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
my $nb_myisam_tables = select_one(
|
my $nb_myisam_tables = select_one(
|
||||||
"SELECT COUNT(*) FROM information_schema.TABLES WHERE ENGINE='MyISAM'"
|
"SELECT COUNT(*) FROM information_schema.TABLES WHERE ENGINE='MyISAM'");
|
||||||
);
|
|
||||||
if ( $nb_myisam_tables == 0 ) {
|
if ( $nb_myisam_tables == 0 ) {
|
||||||
infoprint "No MyISAM table(s) detected ....";
|
infoprint "No MyISAM table(s) detected ....";
|
||||||
return;
|
return;
|
||||||
|
@ -3862,8 +3882,7 @@ sub mysqsl_pfs {
|
||||||
badprint "Performance_schema should be activated.";
|
badprint "Performance_schema should be activated.";
|
||||||
push( @adjvars, "performance_schema=ON" );
|
push( @adjvars, "performance_schema=ON" );
|
||||||
push( @generalrec,
|
push( @generalrec,
|
||||||
"Performance schema should be activated for better diagnostics"
|
"Performance schema should be activated for better diagnostics" );
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if ( $myvar{'performance_schema'} eq 'ON' ) {
|
if ( $myvar{'performance_schema'} eq 'ON' ) {
|
||||||
infoprint "Performance_schema is activated.";
|
infoprint "Performance_schema is activated.";
|
||||||
|
@ -6695,8 +6714,7 @@ sub close_outputfile {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub headerprint {
|
sub headerprint {
|
||||||
prettyprint
|
prettyprint " >> MySQLTuner $tunerversion\n"
|
||||||
" >> MySQLTuner $tunerversion\n"
|
|
||||||
. "\t * Jean-Marie Renouard <jmrenouard\@gmail.com>\n"
|
. "\t * Jean-Marie Renouard <jmrenouard\@gmail.com>\n"
|
||||||
. "\t * Major Hayden <major\@mhtx.net>\n"
|
. "\t * Major Hayden <major\@mhtx.net>\n"
|
||||||
. " >> Bug reports, feature requests, and downloads at http://mysqltuner.pl/\n"
|
. " >> Bug reports, feature requests, and downloads at http://mysqltuner.pl/\n"
|
||||||
|
|
Loading…
Reference in a new issue