From ca04d7bce1e870648035770bcff59d37e35a7d1c Mon Sep 17 00:00:00 2001 From: Long Radix <74498097+longradix@users.noreply.github.com> Date: Mon, 27 Mar 2023 18:12:52 +0200 Subject: [PATCH 1/5] Typos and legibility, mark 7 --- mysqltuner.pl | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 1b57ec9..cb5dbf0 100644 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -1420,13 +1420,13 @@ sub log_file_recommendations { if ( $size > 0 ) { goodprint "Log file $myvar{'log_error'} is not empty"; if ( $size < 32 * 1024 * 1024 ) { - goodprint "Log file $myvar{'log_error'} is smaller than 32 Mb"; + goodprint "Log file $myvar{'log_error'} is smaller than 32 MB"; } else { - badprint "Log file $myvar{'log_error'} is bigger than 32 Mb"; + badprint "Log file $myvar{'log_error'} is bigger than 32 MB"; push @generalrec, $myvar{'log_error'} - . " is > 32Mb, you should analyze why or implement a rotation log strategy such as logrotate!"; + . " is > 32MB, you should analyze why or implement a rotation log strategy such as logrotate!"; } } else { @@ -1850,14 +1850,14 @@ sub get_system_info { infoprint "External IP : " . $ext_ip; $result{'Network'}{'External Ip'} = $ext_ip; badprint - "External IP : Can't check because of Internet connectivity" + "External IP : Can't check, no Internet connectivity" unless defined($httpcli); infoprint "Name Servers : " . infocmd_one "grep 'nameserver' /etc/resolv.conf \| awk '{print \$2}'"; infoprint "Logged In users : "; infocmd_tab "who"; $result{'OS'}{'Logged users'} = `who`; - infoprint "Ram Usages in Mb : "; + infoprint "Ram Usages in MB : "; infocmd_tab "free -m | grep -v +"; $result{'OS'}{'Free Memory RAM'} = `free -m | grep -v +`; infoprint "Load Average : "; @@ -2011,7 +2011,7 @@ sub security_recommendations { #exit 0; if (@mysqlstatlist) { push( @generalrec, - "Remove Anonymous User accounts - there are " + "Remove Anonymous User accounts: there are " . scalar(@mysqlstatlist) . " anonymous accounts." ); foreach my $line ( sort @mysqlstatlist ) { @@ -2547,7 +2547,7 @@ sub check_storage_engines { && defined $myvar{'have_innodb'} && $myvar{'have_innodb'} eq "YES" ) { - badprint "InnoDB is enabled but isn't being used"; + badprint "InnoDB is enabled, but isn't being used"; push( @generalrec, "Add skip-innodb to MySQL configuration to disable InnoDB" ); } @@ -2555,7 +2555,7 @@ sub check_storage_engines { && defined $myvar{'have_bdb'} && $myvar{'have_bdb'} eq "YES" ) { - badprint "BDB is enabled but isn't being used"; + badprint "BDB is enabled, but isn't being used"; push( @generalrec, "Add skip-bdb to MySQL configuration to disable BDB" ); } @@ -2563,7 +2563,7 @@ sub check_storage_engines { && defined $myvar{'have_isam'} && $myvar{'have_isam'} eq "YES" ) { - badprint "MyISAM is enabled but isn't being used"; + badprint "MyISAM is enabled, but isn't being used"; push( @generalrec, "Add skip-isam to MySQL configuration to disable MyISAM (MySQL > 4.1.0)" ); @@ -2592,7 +2592,7 @@ sub check_storage_engines { push @generalrec, $generalrec; } push @generalrec, - "Total freed space after defragmentation : $total_free MiB"; + "Total freed space after defragmentation: $total_free MiB"; } else { goodprint "Total fragmented tables: $fragtables"; From a3e4969538e6f987c580a1f7b7064714cbdf306a Mon Sep 17 00:00:00 2001 From: Long Radix <74498097+longradix@users.noreply.github.com> Date: Mon, 27 Mar 2023 18:33:49 +0200 Subject: [PATCH 2/5] Update mysqltuner.pl --- mysqltuner.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mysqltuner.pl b/mysqltuner.pl index cb5dbf0..08d94ae 100644 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -2254,6 +2254,8 @@ sub validate_mysql_version { $mysqlverminor ||= 0; $mysqlvermicro ||= 0; + prettyprint " "; + if ( mysql_version_eq(8) or mysql_version_eq( 5, 7 ) or mysql_version_eq( 10, 3 ) From 16237f7778a18fd0172085aa071c77d02d49dc47 Mon Sep 17 00:00:00 2001 From: Long Radix <74498097+longradix@users.noreply.github.com> Date: Tue, 28 Mar 2023 19:30:26 +0200 Subject: [PATCH 3/5] Update mysqltuner.pl Remove duplicate code comment --- mysqltuner.pl | 2 -- 1 file changed, 2 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 08d94ae..3af3c1a 100644 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -245,8 +245,6 @@ $opt{nocolor} = 0 if ( $opt{color} == 1 ); # Setting up the colors for the print styles my $me = `whoami`; $me =~ s/\n//g; - -# Setting up the colors for the print styles my $good = ( $opt{nocolor} == 0 ) ? "[\e[0;32mOK\e[0m]" : "[OK]"; my $bad = ( $opt{nocolor} == 0 ) ? "[\e[0;31m!!\e[0m]" : "[!!]"; my $info = ( $opt{nocolor} == 0 ) ? "[\e[0;34m--\e[0m]" : "[--]"; From 1ccba5e556ab73e4fd071f47cc92eab348e44e0b Mon Sep 17 00:00:00 2001 From: Long Radix <74498097+longradix@users.noreply.github.com> Date: Tue, 28 Mar 2023 19:44:04 +0200 Subject: [PATCH 4/5] Update mysqltuner.pl Syntax --- mysqltuner.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 3af3c1a..4da82f1 100644 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -1915,7 +1915,7 @@ sub system_recommendations { . $opt{'maxportallowed'} . "allowed."; push( @generalrec, -"Consider dedicating a server for your database installation with less services running on !" +"Consider dedicating a server for your database installation with fewer services running on it!" ); } else { @@ -1929,7 +1929,7 @@ sub system_recommendations { if ( is_open_port($banport) ) { badprint "Banned port: $banport is opened.."; push( @generalrec, -"Port $banport is opened. Consider stopping program handling this port." +"Port $banport is opened. Consider stopping program handling over this port." ); } else { @@ -1947,7 +1947,7 @@ sub security_recommendations { subheaderprint "Security Recommendations"; if ( mysql_version_eq(8) ) { - infoprint "Skipped due to unsupported feature for MySQL 8"; + infoprint "Skipped due to unsupported feature for MySQL 8.0+"; return; } From 5560381f7d42c145a696f16c26377d6df759dcbe Mon Sep 17 00:00:00 2001 From: Long Radix <74498097+longradix@users.noreply.github.com> Date: Wed, 29 Mar 2023 12:33:47 +0200 Subject: [PATCH 5/5] Update mysqltuner.pl --- mysqltuner.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index 4da82f1..765aea2 100644 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -1929,7 +1929,7 @@ sub system_recommendations { if ( is_open_port($banport) ) { badprint "Banned port: $banport is opened.."; push( @generalrec, -"Port $banport is opened. Consider stopping program handling over this port." +"Port $banport is opened. Consider stopping the program over this port." ); } else {