Limits on used RAM for SNMP devices

Is it possible somehow to set a limit just for used RAM, excluding Swap, on an SNMP device?

I have SNMP hosts that utilize the “check_mk-mem_used” check. On it you can only configure Levels for used memory or free memory, but not specifically for RAM or Swap. The levels only apply to the combined RAM + Swap.

I know that you have to look at RAM and Swap together to diagnose the true memory usage, but it would be useful if you could set individual limits for these metrics.

1 Like

Hi Fabian,

This is a known design limitation: check_mk-mem_used sums RAM and swap, and the WATO rule “Levels for memory usage” only knows combined thresholds. Separate limits for RAM alone don’t exist in the standard check.

Solution: Write your own check plugin that hooks into the already existing hr_mem section (which is populated by hrStorageTable via SNMP). The section already contains RAM and swap separately — it just lacks the check logic to evaluate them separately.

The plugin defines sections=["hr_mem"], creates its own service “Memory RAM”, and gets its own WATO rule with configurable WARN/CRIT values (percentage or absolute as free RAM amount). No second SNMP walk needed — the data is already there.

Before you start: Check which keys the section provides on your devices:

bash

Code kopieren

cmk -d HOSTNAME | grep -A30 "<<<hr_mem"

On Linux SNMP it’s typically “RAM” and “virtual”, on Windows “Physical Memory” — this affects the discovery function.

Greetz Bernd