/usr/share/check_mk/checks-man/mem.used is in check-mk-server 1.2.8p16-1ubuntu0.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | title: Usage of physical and virtual RAM
agents: linux
catalog: os/kernel
license: GPL
distribution: check_mk
description:
This check measures the current usage of physical RAM and
virtual memory used by processes. You can define a warning
and critical level for the usage of virtual memory,
{not} for the usage of RAM.
This is not a bug, it's a feature. In fact it is the only way to do it right
(at least for Linux): What parts of a process currently reside in physical
RAM and what parts are swapped out is not related in a direct way with the
current memory usage.
Linux tends to swap out parts of processes even if RAM is available. It
does this in situations where disk buffers (are assumed to) speed up the
overall performance more than keeping rarely used parts of processes in RAM.
For example after a complete backup of your system you might experiance
that your swap usage has increased while you have more RAM free then
before. That is because Linux has taken RAM from processes in order to
increase disk buffers.
So when defining a level to check against, the only value that is not
affected by such internals of memory management is the total amount of
{virtual} memory used up by processes (not by disk buffers).
Check_MK lets you define levels in percentage of the physically installed RAM
or as absolute values in MB. The default levels are at 150% and 200%. That
means that this check gets critical if the memory used by processes is
twice the size of your RAM.
Hint: If you want to monitor swapping, you probably better measure major
pagefaults. Please look at the check {kernel}.
item:
{None}
inventory:
{mem.used} creates one check on each host that provides
the section {<<<mem>>>}. If that section also outputs
information about the Windows page file, then the check
{<<<mem.win>>>} is being used instead.
examples:
# Change default levels from 150%/200% to 100%/150%:
memused_default_levels = (100.0, 150.0)
checks = [
# make explicit check for hosts with tag "oracle"
( ["oracle"], ALL_HOSTS, "mem.used", None, (80.0, 100.0) ),
# use absolute levels at 8GB / 12GB for some other hosts
( ["host12","host34"], "mem.used", None, (8192, 12288) )
]
perfdata:
Three variables are stored: the physical RAM,
the used swap space and the sum of both. Maximum
values for both variables are also transmitted, so that
they can be visualized. All values are in Megabytes (1024 * 1024 bytes).
The template for PNP4Nagios that is shipped with check_mk
stacks swap usage on top of RAM usage und thus shows
the amount of virtual RAM that is used by processes.
On Linux some additional performance values are output,
for example the size of the page tables and the shared
memory.
If averaging is turned on, then a value {memusedavg} is added.
[parameters]
parameters (dict): The check previously used a pair of
two numbers as a parameter. While this is internally still
supported, the new format is a dictionary with the following
keys:
{"levels"}: A pair of two int or float values: if these are
float it means the the percentage of virtual memory used
by processes at which WARNING/CRIT state is triggered. If the
two numbers are defined as an integer value then they are interpreted
as an absolute value in megabytes.
{"average"}: This key is optional. If set (integer), it means
a number of minutes. The levels are then applied to the
averaged value over that time horizon.
[configuration]
memused_default_levels (float, float): Levels used by
all checks that are created by inventory.
|