@@ -403,7 +403,7 @@ sub pretty_uptime {
403
403
}
404
404
405
405
# Retrieves the memory installed on this machine
406
- my ( $physical_memory , $swap_memory , $duflags );
406
+ my ( $physical_memory , $swap_memory , $duflags , $xargsflags );
407
407
408
408
sub memerror {
409
409
badprint
@@ -414,6 +414,7 @@ sub memerror {
414
414
sub os_setup {
415
415
my $os = ` uname` ;
416
416
$duflags = ( $os =~ / Linux/ ) ? ' -b' : ' ' ;
417
+ $xargsflags = ( $os =~ / Darwin|SunOS/ ) ? ' ' : ' -r' ;
417
418
if ( $opt {' forcemem' } > 0 ) {
418
419
$physical_memory = $opt {' forcemem' } * 1048576;
419
420
infoprint " Assuming $opt {'forcemem'} MB of physical memory" ;
@@ -2562,30 +2563,23 @@ sub calculations {
2562
2563
my $size = 0;
2563
2564
$size += (split )[0]
2564
2565
for
2565
- ` find $myvar {'datadir'} -name "*.MYI" 2>&1 | xargs du -L $duflags 2>&1` ;
2566
+ ` find " $myvar {'datadir'}" -name "*.MYI" -print0 2>&1 | xargs $xargsflags -0 du -L $duflags 2>&1` ;
2566
2567
$mycalc {' total_myisam_indexes' } = $size ;
2567
- $mycalc {' total_aria_indexes' } = 0;
2568
+ $size = 0 + (split )[0]
2569
+ for
2570
+ ` find "$myvar {'datadir'}" -name "*.MAI" -print0 2>&1 | xargs $xargsflags -0 du -L $duflags 2>&1` ;
2571
+ $mycalc {' total_aria_indexes' } = $size ;
2568
2572
}
2569
2573
elsif ( mysql_version_ge(5) ) {
2570
2574
$mycalc {' total_myisam_indexes' } = select_one
2571
2575
" SELECT IFNULL(SUM(INDEX_LENGTH),0) FROM information_schema.TABLES WHERE TABLE_SCHEMA NOT IN ('information_schema') AND ENGINE = 'MyISAM';" ;
2572
2576
$mycalc {' total_aria_indexes' } = select_one
2573
2577
" SELECT IFNULL(SUM(INDEX_LENGTH),0) FROM information_schema.TABLES WHERE TABLE_SCHEMA NOT IN ('information_schema') AND ENGINE = 'Aria';" ;
2574
2578
}
2575
- if ( defined $mycalc {' total_myisam_indexes' }
2576
- and $mycalc {' total_myisam_indexes' } == 0 )
2577
- {
2578
- $mycalc {' total_myisam_indexes' } = " fail" ;
2579
- }
2580
- elsif ( defined $mycalc {' total_myisam_indexes' } ) {
2579
+ if ( defined $mycalc {' total_myisam_indexes' } ) {
2581
2580
chomp ( $mycalc {' total_myisam_indexes' } );
2582
2581
}
2583
- if ( defined $mycalc {' total_aria_indexes' }
2584
- and $mycalc {' total_aria_indexes' } == 0 )
2585
- {
2586
- $mycalc {' total_aria_indexes' } = 1;
2587
- }
2588
- elsif ( defined $mycalc {' total_aria_indexes' } ) {
2582
+ if ( defined $mycalc {' total_aria_indexes' } ) {
2589
2583
chomp ( $mycalc {' total_aria_indexes' } );
2590
2584
}
2591
2585
@@ -3390,19 +3384,11 @@ sub mysql_myisam {
3390
3384
}
3391
3385
3392
3386
# Key buffer
3393
- if ( !defined ( $mycalc {' total_myisam_indexes' } ) and $doremote == 1 ) {
3387
+ if ( !defined ( $mycalc {' total_myisam_indexes' } ) ) {
3394
3388
push ( @generalrec ,
3395
- " Unable to calculate MyISAM indexes on remote MySQL server < 5.0.0"
3389
+ " Unable to calculate MyISAM index size on MySQL server < 5.0.0"
3396
3390
);
3397
3391
}
3398
- elsif ( $mycalc {' total_myisam_indexes' } =~ / ^fail$ / ) {
3399
- badprint
3400
- " Cannot calculate MyISAM index size - re-run script as root user" ;
3401
- }
3402
- elsif ( $mycalc {' total_myisam_indexes' } == " 0" ) {
3403
- badprint
3404
- " None of your MyISAM tables are indexed - add indexes immediately" ;
3405
- }
3406
3392
else {
3407
3393
if ( $myvar {' key_buffer_size' } < $mycalc {' total_myisam_indexes' }
3408
3394
&& $mycalc {' pct_keys_from_mem' } < 95 )
@@ -5032,31 +5018,27 @@ sub mysqsl_pfs {
5032
5018
5033
5019
}
5034
5020
5035
- # Recommendations for Ariadb
5036
- sub mariadb_ariadb {
5037
- subheaderprint " AriaDB Metrics" ;
5021
+ # Recommendations for Aria Engine
5022
+ sub mariadb_aria {
5023
+ subheaderprint " Aria Metrics" ;
5038
5024
5039
- # AriaDB
5040
- unless ( defined $myvar {' have_aria' }
5041
- and $myvar {' have_aria' } eq " YES" )
5025
+ # Aria
5026
+ if ( ! defined $myvar {' have_aria' } )
5027
+ {
5028
+ infoprint " Aria Storage Engine not available." ;
5029
+ return ;
5030
+ }
5031
+ if ( $myvar {' have_aria' } ne " YES" )
5042
5032
{
5043
- infoprint " AriaDB is disabled." ;
5033
+ infoprint " Aria Storage Engine is disabled." ;
5044
5034
return ;
5045
5035
}
5046
- infoprint " AriaDB is enabled." ;
5036
+ infoprint " Aria Storage Engine is enabled." ;
5047
5037
5048
5038
# Aria pagecache
5049
- if ( !defined ( $mycalc {' total_aria_indexes' } ) and $doremote == 1 ) {
5039
+ if ( !defined ( $mycalc {' total_aria_indexes' } ) ) {
5050
5040
push ( @generalrec ,
5051
- " Unable to calculate Aria indexes on remote MySQL server < 5.0.0" );
5052
- }
5053
- elsif ( $mycalc {' total_aria_indexes' } =~ / ^fail$ / ) {
5054
- badprint
5055
- " Cannot calculate Aria index size - re-run script as root user" ;
5056
- }
5057
- elsif ( $mycalc {' total_aria_indexes' } == " 0" ) {
5058
- badprint
5059
- " None of your Aria tables are indexed - add indexes immediately" ;
5041
+ " Unable to calculate Aria index size on MySQL server" );
5060
5042
}
5061
5043
else {
5062
5044
if (
@@ -6389,7 +6371,7 @@ sub which {
6389
6371
mariadb_threadpool; # Print MariaDB ThreadPool stats
6390
6372
mysql_myisam; # Print MyISAM stats
6391
6373
mysql_innodb; # Print InnoDB stats
6392
- mariadb_ariadb ; # Print MariaDB AriaDB stats
6374
+ mariadb_aria ; # Print MariaDB Aria stats
6393
6375
mariadb_tokudb; # Print MariaDB Tokudb stats
6394
6376
mariadb_xtradb; # Print MariaDB XtraDB stats
6395
6377
0 commit comments