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";
|
||||
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;
|
||||
}
|
||||
elsif ( $myvar{'log_error'} =~ /^(docker|podman|kubectl):(.*)/ ) {
|
||||
|
@ -1945,21 +1946,25 @@ sub security_recommendations {
|
|||
debugprint "Password column = $PASS_COLUMN_NAME";
|
||||
|
||||
# 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 = "";
|
||||
$extra_user_condition = "IS_ROLE = 'N' AND" if $is_role_column > 0;
|
||||
my @mysqlstatlist;
|
||||
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 ) {
|
||||
chomp($line);
|
||||
infoprint "User $line is User Role";
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
debugprint "No Role user detected";
|
||||
goodprint "No Role user detected";
|
||||
}
|
||||
|
||||
# Looking for Anonymous users
|
||||
@mysqlstatlist = select_array
|
||||
"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: "
|
||||
. (
|
||||
( 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'
|
||||
);
|
||||
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'
|
||||
);
|
||||
if ( scalar( keys %myrepl ) == 0 and scalar( keys %myslaves ) == 0 ) {
|
||||
|
@ -2156,13 +2169,15 @@ sub get_replication_status {
|
|||
}
|
||||
|
||||
$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 ";
|
||||
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 ";
|
||||
|
||||
|
||||
my ($seconds_behind_master) = $myrepl{'Seconds_Behind_Master'} // $myrepl{'Seconds_Behind_Source'} ;
|
||||
my ($seconds_behind_master) = $myrepl{'Seconds_Behind_Master'}
|
||||
// $myrepl{'Seconds_Behind_Source'};
|
||||
$seconds_behind_master = 1000000 unless defined($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, 6 )
|
||||
or mysql_version_eq( 10, 7 )
|
||||
or mysql_version_eq( 10, 8 )
|
||||
)
|
||||
or mysql_version_eq( 10, 8 ) )
|
||||
{
|
||||
goodprint "Currently running supported MySQL version "
|
||||
. $myvar{'version'} . "";
|
||||
return;
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
badprint "Your MySQL version "
|
||||
. $myvar{'version'}
|
||||
. " is EOL software! Upgrade soon!";
|
||||
push ( @generalrec, "You are using n unsupported version for production environments");
|
||||
push ( @generalrec, "Upgrade as soon as possible to a supported version !");
|
||||
push( @generalrec,
|
||||
"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
|
||||
"Skipped name resolution test due to missing skip_name_resolve in system variables.";
|
||||
}
|
||||
|
||||
#Cpanel and Skip name resolve
|
||||
elsif ( -r "/usr/local/cpanel/cpanel" ) {
|
||||
if ( $result{'Variables'}{'skip_name_resolve'} ne 'OFF' ) {
|
||||
|
@ -3195,7 +3213,9 @@ sub mysql_stats {
|
|||
}
|
||||
if ( $result{'Variables'}{'skip_name_resolve'} eq 'OFF' ) {
|
||||
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" );
|
||||
}
|
||||
}
|
||||
|
@ -3622,13 +3642,13 @@ sub mysql_myisam {
|
|||
infoprint "MyISAM Metrics are disabled on last MySQL versions.";
|
||||
if ( $myvar{'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;
|
||||
}
|
||||
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 ) {
|
||||
infoprint "No MyISAM table(s) detected ....";
|
||||
return;
|
||||
|
@ -3862,8 +3882,7 @@ sub mysqsl_pfs {
|
|||
badprint "Performance_schema should be activated.";
|
||||
push( @adjvars, "performance_schema=ON" );
|
||||
push( @generalrec,
|
||||
"Performance schema should be activated for better diagnostics"
|
||||
);
|
||||
"Performance schema should be activated for better diagnostics" );
|
||||
}
|
||||
if ( $myvar{'performance_schema'} eq 'ON' ) {
|
||||
infoprint "Performance_schema is activated.";
|
||||
|
@ -6695,8 +6714,7 @@ sub close_outputfile {
|
|||
}
|
||||
|
||||
sub headerprint {
|
||||
prettyprint
|
||||
" >> MySQLTuner $tunerversion\n"
|
||||
prettyprint " >> MySQLTuner $tunerversion\n"
|
||||
. "\t * Jean-Marie Renouard <jmrenouard\@gmail.com>\n"
|
||||
. "\t * Major Hayden <major\@mhtx.net>\n"
|
||||
. " >> Bug reports, feature requests, and downloads at http://mysqltuner.pl/\n"
|
||||
|
|
Loading…
Reference in a new issue