1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00
samba-mirror/ctdb/tests/eventscripts/05.system.monitor.017.sh
Martin Schwenke 0f28ccf87a ctdb-scripts: Add default system memory usage warnings
CTDB should warn by default if too much system memory or swap is used.

The tests have also been tweaked.  In particular, the filesystem-only
tests need to initialise the memory information to avoid errors where
meminfo isn't set.

Document the defaults, warning against disabling them.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2015-08-29 17:06:25 +02:00

41 lines
1.1 KiB
Bash
Executable File

#!/bin/sh
. "${TEST_SCRIPTS_DIR}/unit.sh"
define_test "Memory check, bad situation, both custom memory checks, causes unhealthy"
setup_memcheck 87 0
CTDB_MONITOR_MEMORY_USAGE="70:80"
CTDB_MONITOR_SWAP_USAGE=""
required_result 1 <<EOF
ERROR: System memory utilization 87% >= threshold 80%
MemTotal: 3940712 kB
MemFree: 225268 kB
Buffers: 146120 kB
Cached: 140904 kB
SwapCached: 56016 kB
Active: 2422104 kB
Inactive: 1019928 kB
Active(anon): 1917580 kB
Inactive(anon): 523080 kB
Active(file): 504524 kB
Inactive(file): 496848 kB
Unevictable: 4844 kB
Mlocked: 4844 kB
SwapTotal: 5857276 kB
SwapFree: 5857276 kB
...
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 2 0.0 0.0 0 0 ? S Aug28 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? S Aug28 0:43 \_ [ksoftirqd/0]
...
root 1 0.0 0.0 2976 624 ? Ss Aug28 0:07 init [2]
root 495 0.0 0.0 3888 1640 ? Ss Aug28 0:00 udevd --daemon
...
[MORE FAKE ps OUTPUT]
EOF
simple_test