This commit is contained in:
root 2016-12-08 11:29:59 +01:00
commit 7f02c8655c

View file

@ -1127,8 +1127,8 @@ sub log_file_recommandations {
goodprint "Log file $myvar{'log_error'} is smaller than 32 Mb"; goodprint "Log file $myvar{'log_error'} is smaller than 32 Mb";
} else { } 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, push @generalrec,
$myvar{'log_error'} ."is > 32Mb, you should analyze why or implement a rotation log strategy such as logrotate!" ); $myvar{'log_error'} ."is > 32Mb, you should analyze why or implement a rotation log strategy such as logrotate!" ;
} }
my @log_content = get_file_contents($myvar{'log_error'}); my @log_content = get_file_contents($myvar{'log_error'});
@ -1148,28 +1148,36 @@ sub log_file_recommandations {
} }
if ( $nbWarnLog > 0 ) { if ( $nbWarnLog > 0 ) {
badprint "$myvar{'log_error'} contains $nbWarnLog warning(s)."; badprint "$myvar{'log_error'} contains $nbWarnLog warning(s).";
push( @generalrec, "Control warning line(s) into $myvar{'log_error'} file"); push @generalrec, "Control warning line(s) into $myvar{'log_error'} file";
} else { } else {
goodprint "$myvar{'log_error'} doesn't contain any warning."; goodprint "$myvar{'log_error'} doesn't contain any warning.";
} }
if ( $nbErrLog > 0 ) { if ( $nbErrLog > 0 ) {
badprint "$myvar{'log_error'} contains $nbErrLog error(s)."; badprint "$myvar{'log_error'} contains $nbErrLog error(s).";
push( @generalrec, "Control error line(s) into $myvar{'log_error'} file"); push @generalrec, "Control error line(s) into $myvar{'log_error'} file";
} else { } else {
goodprint "$myvar{'log_error'} doesn't contain any error."; goodprint "$myvar{'log_error'} doesn't contain any error.";
} }
infoprint scalar(@lastStarts). " start(s) detected in $myvar{'log_error'}"; infoprint scalar @lastStarts . " start(s) detected in $myvar{'log_error'}";
my $nStart = 0; my $nStart = 0;
for my $startd (reverse @lastStarts[-10..-1]) { my $nEnd = 10;
if ( scalar @lastStarts < $nEnd ) {
$nEnd = scalar @lastStarts;
}
for my $startd ( reverse @lastStarts[-$nEnd..-1] ) {
$nStart++; $nStart++;
infoprint "$nStart) $startd"; infoprint "$nStart) $startd";
} }
infoprint scalar(@lastShutdowns). " shutdown(s) detected in $myvar{'log_error'}"; infoprint scalar @lastShutdowns . " shutdown(s) detected in $myvar{'log_error'}";
my $nShut=0; $nStart=0;
for my $shutd (reverse @lastShutdowns[-10..-1]) { $nEnd=10;
$nShut++; if ( scalar @lastShutdowns < $nEnd ) {
infoprint "$nShut) $shutd"; $nEnd = scalar @lastShutdowns;
}
for my $shutd ( reverse @lastShutdowns[-$nEnd..-1] ) {
$nStart++;
infoprint "$nStart) $shutd";
} }
#exit 0; #exit 0;
} }
@ -2736,17 +2744,10 @@ sub mysql_stats {
push( @generalrec, push( @generalrec,
"Upgrade MySQL to version 4+ to utilize query caching" ); "Upgrade MySQL to version 4+ to utilize query caching" );
} }
elsif ( mysql_version_ge( 5, 5 ) and !mysql_version_ge( 10, 1 ) ) { elsif ( mysql_version_ge( 5, 5 ) and !mysql_version_ge( 10, 1 ) and $myvar{'query_cache_type'} eq "OFF" ) {
if ( $myvar{'query_cache_type'} ne "OFF" ) {
badprint
"Query cache may be disabled by default due to mutex contention.";
push( @adjvars, "query_cache_type (=0)" );
}
else {
goodprint goodprint
"Query cache is disabled by default due to mutex contention on multiprocessor machines."; "Query cache is disabled by default due to mutex contention on multiprocessor machines.";
} }
}
elsif ( $myvar{'query_cache_size'} < 1 ) { elsif ( $myvar{'query_cache_size'} < 1 ) {
badprint "Query cache is disabled"; badprint "Query cache is disabled";
push( @adjvars, "query_cache_size (>= 8M)" ); push( @adjvars, "query_cache_size (>= 8M)" );
@ -2760,6 +2761,9 @@ sub mysql_stats {
"Query cache cannot be analyzed - no SELECT statements executed"; "Query cache cannot be analyzed - no SELECT statements executed";
} }
else { else {
badprint
"Query cache may be disabled by default due to mutex contention.";
push( @adjvars, "query_cache_type (=0)" );
if ( $mycalc{'query_cache_efficiency'} < 20 ) { if ( $mycalc{'query_cache_efficiency'} < 20 ) {
badprint badprint
"Query cache efficiency: $mycalc{'query_cache_efficiency'}% (" "Query cache efficiency: $mycalc{'query_cache_efficiency'}% ("