Skip to content
Browse files

AIX Support thanks to Walter Huf <Walter.Huf@qg.com>

  • Loading branch information...
1 parent 491d911 commit 466c8e68a080bf44709590dbc551f2ef0f059ff6 @justintime committed Sep 19, 2011
Showing with 19 additions and 0 deletions.
  1. +19 −0 check_mem.pl
View
19 check_mem.pl
@@ -190,6 +190,25 @@ sub get_memory_info {
$used_memory_kb = $total_memory_kb - $free_memory_kb;
}
}
+ elsif ( $uname =~ /AIX/ ) {
+ my @meminfo = `/usr/bin/vmstat -v`;
+ foreach (@meminfo) {
+ chomp;
+ if (/^\s*([0-9.]+)\s+(.*)/) {
+ my $counter_name = $2;
+ if ($counter_name eq 'memory pages') {
+ $total_memory_kb = $1*4;
+ }
+ if ($counter_name eq 'free pages') {
+ $free_memory_kb = $1*4;
+ }
+ if ($counter_name eq 'file pages') {
+ $caches_kb = $1*4;
+ }
+ }
+ }
+ $used_memory_kb = $total_memory_kb - $free_memory_kb;
+ }
else {
if ($opt_C) {
print "You can't report on $uname caches!\n";

0 comments on commit 466c8e6

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