summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcheck_mem12
1 files changed, 10 insertions, 2 deletions
diff --git a/check_mem b/check_mem
index 8d83bc3..d3c0722 100755
--- a/check_mem
+++ b/check_mem
@@ -118,7 +118,14 @@ unless ($context) {
my @mem = get_mem($n, $context);
if (@mem) {
my %values;
+ my %desc;
($values{'VM'}, $values{'RSS'}, $values{'ANON'}, $values{'VML'}) = @mem;
+ %desc = (
+ VM => 'virtual memory',
+ RSS => 'resident set size',
+ ANON => 'anonymous memory',
+ VML => 'locked memory',
+ );
my @status = [ UNKNOWN ];
my $output = "";
@@ -138,10 +145,11 @@ if (@mem) {
)
);
- $output .= " $values{$mem}";
+ $values{$mem} = int(($values{$mem} / 1024) / 1024);
+ $output .= " - $desc{$mem}: $values{$mem}MB";
}
- $n->nagios_exit($n->max_state(@status), "memory statistics:$output");
+ $n->nagios_exit($n->max_state(@status), "used memory$output");
}
$n->nagios_exit(UNKNOWN, 'unable to parse memory statistics');