From f0f9f3f325765c9d76175a31982191bcc81f31c6 Mon Sep 17 00:00:00 2001 From: rackerhacker Date: Thu, 17 Sep 2009 23:24:33 +0000 Subject: [PATCH] Added AIX 5L support (patch from Baptiste M. via the blog) Adjusted the version number (should have been done for the 1.1.0 tagged release) --- mysqltuner.pl | 61 ++++++++++++++++++++++++++++----------------------- 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/mysqltuner.pl b/mysqltuner.pl index e3ba4bc..c1c9f5b 100755 --- a/mysqltuner.pl +++ b/mysqltuner.pl @@ -20,19 +20,16 @@ # along with this program. If not, see . # # This project would not be possible without help from: -# Matthew Montgomery Paul Kehrer -# Dave Burgess Jonathan Hinds -# Mike Jackson Nils Breunese -# Shawn Ashlee Luuk Vosslamber -# Ville Skytta Trent Hornibrook -# Jason Gill Mark Imbriaco -# Greg Eden Aubin Galinotti -# Giovanni Bechis Bill Bradford -# Ryan Novosielski Michael Scheidell -# Blair Christensen Hans du Plooy -# Victor Trac Everett Barnes -# Tom Krouper Gary Barrueto -# Simon Greenaway Adam Stein +# Matthew Montgomery Paul Kehrer Dave Burgess +# Jonathan Hinds Mike Jackson Nils Breunese +# Shawn Ashlee Luuk Vosslamber Ville Skytta +# Trent Hornibrook Jason Gill Mark Imbriaco +# Greg Eden Aubin Galinotti Giovanni Bechis +# Bill Bradford Ryan Novosielski Michael Scheidell +# Blair Christensen Hans du Plooy Victor Trac +# Everett Barnes Tom Krouper Gary Barrueto +# Simon Greenaway Adam Stein Isart Montane +# Baptiste M. # # Inspired by Matthew Montgomery's tuning-primer.sh script: # http://forge.mysql.com/projects/view.php?id=44 @@ -43,24 +40,24 @@ use diagnostics; use Getopt::Long; # Set up a few variables for use in the script -my $tunerversion = "1.0.1"; +my $tunerversion = "1.1.0"; my (@adjvars, @generalrec); # Set defaults my %opt = ( - "nobad" => 0, - "nogood" => 0, - "noinfo" => 0, - "nocolor" => 0, - "forcemem" => 0, - "forceswap" => 0, - "host" => 0, - "socket" => 0, - "port" => 0, - "user" => 0, - "pass" => 0, - "skipsize" => 0, - "checkversion" => 0, + "nobad" => 0, + "nogood" => 0, + "noinfo" => 0, + "nocolor" => 0, + "forcemem" => 0, + "forceswap" => 0, + "host" => 0, + "socket" => 0, + "port" => 0, + "user" => 0, + "pass" => 0, + "skipsize" => 0, + "checkversion" => 0, ); # Gather the options from the command line @@ -232,6 +229,13 @@ sub os_setup { $physical_memory = `/usr/sbin/prtconf | grep Memory | cut -f 3 -d ' '` or memerror; chomp($physical_memory); $physical_memory = $physical_memory*1024*1024; + } elsif ($os =~ /AIX/) { + $physical_memory = `lsattr -El sys0 | grep realmem | awk '{print \$2}'` or memerror; + chomp($physical_memory); + $physical_memory = $physical_memory*1024; + $swap_memory = `lsps -as | awk -F"(MB| +)" '/MB /{print \$2}'` or memerror; + chomp($swap_memory); + $swap_memory = $swap_memory*1024*1024; } } chomp($physical_memory); @@ -425,6 +429,9 @@ sub check_architecture { } elsif (`uname` !~ /SunOS/ && `uname -m` =~ /64/) { $arch = 64; goodprint "Operating on 64-bit architecture\n"; + } elsif (`uname` =~ /AIX/ && `bootinfo -K` =~ /64/) { + $arch = 64; + goodprint "Operating on 64-bit architecture\n"; } else { $arch = 32; if ($physical_memory > 2147483648) {