Skip to content

Commit 4731aea

Browse files
committed
memory graphs: Fix 'RAM' for linux
CMK-20592 Change-Id: I41cd7d247c89e550669cfe7fad9bf0e3b44536ba
1 parent f154c54 commit 4731aea

File tree

3 files changed

+39
-7
lines changed

3 files changed

+39
-7
lines changed

cmk/base/legacy_checks/mem_linux.py

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def check_mem_linux(_no_item, params, section):
3939
+ section.get("SReclaimable", 0)
4040
)
4141

42+
# RAM, https://github.com/Checkmk/checkmk/commit/1657414506bfe8f4001f3e10ef648947276ad75d
4243
section["MemUsed"] = section["MemTotal"] - section["MemFree"] - section["Caches"]
4344
section["SwapUsed"] = section["SwapTotal"] - section["SwapFree"]
4445
section["TotalTotal"] = section["MemTotal"] + section["SwapTotal"]

cmk/plugins/memory/graphing/mem.py

+38-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
name="swap_cached",
6060
title=Title("Swap cached"),
6161
unit=UNIT_BYTES,
62-
color=Color.LIGHT_GREEN,
62+
color=Color.PINK,
6363
)
6464
metric_mem_lnx_slab = Metric(
6565
name="mem_lnx_slab",
@@ -79,6 +79,12 @@
7979
unit=UNIT_BYTES,
8080
color=Color.CYAN,
8181
)
82+
metric_sreclaimable = Metric(
83+
name="sreclaimable",
84+
title=Title("Reclaimable slab"),
85+
unit=UNIT_BYTES,
86+
color=Color.ORANGE,
87+
)
8288

8389
perfometer_mem_used = Perfometer(
8490
name="mem_used",
@@ -151,6 +157,37 @@
151157
"mem_used",
152158
"mem_free",
153159
),
160+
conflicting=("mem_lnx_cached", "mem_lnx_buffers"),
161+
)
162+
graph_mem_absolute_2 = Graph(
163+
name="mem_absolute_2",
164+
title=Title("RAM"),
165+
simple_lines=(
166+
# see mem_linux.py
167+
Sum(
168+
Title("Total RAM"),
169+
Color.DARK_BLUE,
170+
(
171+
"mem_used",
172+
"mem_free",
173+
"mem_lnx_cached",
174+
"mem_lnx_buffers",
175+
"swap_cached",
176+
"sreclaimable",
177+
),
178+
),
179+
WarningOf("mem_used"),
180+
CriticalOf("mem_used"),
181+
),
182+
compound_lines=(
183+
"mem_used",
184+
"mem_free",
185+
"mem_lnx_cached",
186+
"mem_lnx_buffers",
187+
"swap_cached",
188+
"sreclaimable",
189+
),
190+
optional=("swap_cached", "sreclaimable"),
154191
)
155192
graph_ram_swap_used = Graph(
156193
name="ram_swap_used",

cmk/plugins/memory/graphing/standalone.py

-6
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@
2020
unit=UNIT_BYTES,
2121
color=Color.PURPLE,
2222
)
23-
metric_sreclaimable = Metric(
24-
name="sreclaimable",
25-
title=Title("Reclaimable slab"),
26-
unit=UNIT_BYTES,
27-
color=Color.PURPLE,
28-
)
2923
metric_sunreclaim = Metric(
3024
name="sunreclaim",
3125
title=Title("Unreclaimable slab"),

0 commit comments

Comments
 (0)