diff options
-rwxr-xr-x | check_mem | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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'); |