Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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)
  • Loading branch information...
commit f0f9f3f325765c9d76175a31982191bcc81f31c6 1 parent 32cf710
Major Hayden authored September 17, 2009

Showing 1 changed file with 34 additions and 27 deletions. Show diff stats Hide diff stats

  1. 61  mysqltuner.pl
61  mysqltuner.pl
@@ -20,19 +20,16 @@
20 20
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
21 21
 #
22 22
 # This project would not be possible without help from:
23  
-#   Matthew Montgomery     Paul Kehrer
24  
-#   Dave Burgess           Jonathan Hinds
25  
-#   Mike Jackson           Nils Breunese
26  
-#   Shawn Ashlee           Luuk Vosslamber
27  
-#   Ville Skytta           Trent Hornibrook
28  
-#   Jason Gill             Mark Imbriaco
29  
-#   Greg Eden              Aubin Galinotti
30  
-#   Giovanni Bechis        Bill Bradford
31  
-#   Ryan Novosielski       Michael Scheidell
32  
-#   Blair Christensen      Hans du Plooy
33  
-#   Victor Trac            Everett Barnes
34  
-#   Tom Krouper            Gary Barrueto
35  
-#   Simon Greenaway        Adam Stein
  23
+#   Matthew Montgomery     Paul Kehrer          Dave Burgess
  24
+#   Jonathan Hinds         Mike Jackson         Nils Breunese
  25
+#   Shawn Ashlee           Luuk Vosslamber      Ville Skytta
  26
+#   Trent Hornibrook       Jason Gill           Mark Imbriaco
  27
+#   Greg Eden              Aubin Galinotti      Giovanni Bechis
  28
+#   Bill Bradford          Ryan Novosielski     Michael Scheidell
  29
+#   Blair Christensen      Hans du Plooy        Victor Trac
  30
+#   Everett Barnes         Tom Krouper          Gary Barrueto
  31
+#   Simon Greenaway        Adam Stein           Isart Montane
  32
+#   Baptiste M.
36 33
 #
37 34
 # Inspired by Matthew Montgomery's tuning-primer.sh script:
38 35
 # http://forge.mysql.com/projects/view.php?id=44
@@ -43,24 +40,24 @@
43 40
 use Getopt::Long;
44 41
 
45 42
 # Set up a few variables for use in the script
46  
-my $tunerversion = "1.0.1";
  43
+my $tunerversion = "1.1.0";
47 44
 my (@adjvars, @generalrec);
48 45
 
49 46
 # Set defaults
50 47
 my %opt = (
51  
-		"nobad" => 0,
52  
-		"nogood" => 0,
53  
-		"noinfo" => 0,
54  
-		"nocolor" => 0,
55  
-		"forcemem" => 0,
56  
-		"forceswap" => 0,
57  
-		"host" => 0,
58  
-		"socket" => 0,
59  
-		"port" => 0,
60  
-		"user" => 0,
61  
-		"pass" => 0,
62  
-		"skipsize" => 0,
63  
-		"checkversion" => 0,
  48
+		"nobad" 		=> 0,
  49
+		"nogood" 		=> 0,
  50
+		"noinfo" 		=> 0,
  51
+		"nocolor" 		=> 0,
  52
+		"forcemem" 		=> 0,
  53
+		"forceswap" 	=> 0,
  54
+		"host" 			=> 0,
  55
+		"socket" 		=> 0,
  56
+		"port" 			=> 0,
  57
+		"user" 			=> 0,
  58
+		"pass"			=> 0,
  59
+		"skipsize" 		=> 0,
  60
+		"checkversion" 	=> 0,
64 61
 	);
65 62
 	
66 63
 # Gather the options from the command line
@@ -232,6 +229,13 @@ sub os_setup {
232 229
 			$physical_memory = `/usr/sbin/prtconf | grep Memory | cut -f 3 -d ' '` or memerror;
233 230
 			chomp($physical_memory);
234 231
 			$physical_memory = $physical_memory*1024*1024;
  232
+		} elsif ($os =~ /AIX/) {
  233
+			$physical_memory = `lsattr -El sys0 | grep realmem | awk '{print \$2}'` or memerror;
  234
+			chomp($physical_memory);
  235
+			$physical_memory = $physical_memory*1024;
  236
+			$swap_memory = `lsps -as | awk -F"(MB| +)" '/MB /{print \$2}'` or memerror;
  237
+			chomp($swap_memory);
  238
+			$swap_memory = $swap_memory*1024*1024;
235 239
 		}
236 240
 	}
237 241
 	chomp($physical_memory);
@@ -425,6 +429,9 @@ sub check_architecture {
425 429
 	} elsif (`uname` !~ /SunOS/ && `uname -m` =~ /64/) {
426 430
 		$arch = 64;
427 431
 		goodprint "Operating on 64-bit architecture\n";
  432
+	} elsif (`uname` =~ /AIX/ && `bootinfo -K` =~ /64/) {
  433
+		$arch = 64;
  434
+		goodprint "Operating on 64-bit architecture\n";
428 435
 	} else {
429 436
 		$arch = 32;
430 437
 		if ($physical_memory > 2147483648) {

0 notes on commit f0f9f3f

Please sign in to comment.
Something went wrong with that request. Please try again.