[Nagiosplug-devel] check_mem.sh
Andreas Ericsson
ae at op5.se
Thu May 13 00:38:01 CEST 2004
Hi all.
I was having some problems with the check_mem.pl script, so I rewrote it
in sh. It now uses /proc/meminfo instead of vmstat, which isn't
available on all platforms I've encountered.
This can also be used as a replacement for check_swap, by specifying
'check_mem.sh swap', so I suggest we get rid of the check_swap.c
program. I'll have check_mem.sh accept symlinks as arguments (i.e.
"check_swap" = "check_mem.sh swap" and so on), so that command
definitions can be kept down.
Syntax:
check_mem.sh <type> -w <warn> -c <crit> [-r] -[g|m|k|b] [-q]
Where type is one of ram, mem, total or swap (ram and mem are the same).
It measures USED memory in % values, unless the -r switch is specified.
In that case it measures FREE memory in % values.
Use the -q switch if you want to use it for statistics harvesting, and
one of -g, -m, -k (default), -b switches for output in GBytes, MBytes,
Kbytes or Bytes, respectively.
Output if -q is used is as such;
used_pct:used:total
Wrap it in scripts if you want some other values, or modify the source
if you like.
Issues:
Since linux caches everything as long as there's RAM available, cache is
deducted from the final result. Buffers, however, are not (buffers is
what databases use, and we want that to show properly). If one or more
of you think this is a Bad Thing, I'll look into changing it.
Let me know if you find any bugs.
--
Mvh
Andreas Ericsson
OP5 AB
+46 (0)733 709032
andreas.ericsson at op5.se
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_mem.sh
Type: text/x-sh
Size: 5014 bytes
Desc: not available
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20040513/10c4a0ea/attachment.sh>
More information about the Devel
mailing list