Use of uninitialized value #304

tidify script
This commit is contained in:
root 2017-03-06 15:17:43 +01:00
parent 48be29a288
commit f04b32c854
2 changed files with 27 additions and 13 deletions

View file

@ -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 <http://www.gnu.org/licenses/>.

View file

@ -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 @@ group by c.table_schema,c.table_name
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:";