check_mem.pl returns negative result when count OS caches as FREE memory

Bug #1975886 reported by Linda Guo
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
NRPE Charm
Fix Released
High
Linda Guo

Bug Description

check_mem returns negative memory usage when counting OS caches as FREE memory (with -C option). Looks like caches_kb is calculated via caches_kb = MemAvailable+Buffers+Cached+SReclaimable -Shmem. I think this bug was introduced by this MP https://code.launchpad.net/~afreiberger/charm-nrpe/+git/charm-nrpe/+merge/403532

$./check_mem.pl -u -w 97 -c 98 -h -C
OK - -51.6% (-545413716 kB) used.|TOTAL=1056743416KB;;;; USED=-545413716KB;1025041113;1035608547;; FREE=1602157132KB;;;; CACHES=949089652KB;;;; HUGEPAGES=0KB;;;;

$ cat /proc/meminfo
MemTotal: 1056743416 kB
MemFree: 653040840 kB
MemAvailable: 799941548 kB
Buffers: 1322236 kB
Cached: 147247296 kB
SwapCached: 69164 kB
Active: 247599804 kB

Related branches

Linda Guo (lihuiguo)
Changed in charm-nrpe:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
Linda Guo (lihuiguo) wrote :
Alvaro Uria (aluria)
Changed in charm-nrpe:
status: Confirmed → Fix Committed
Eric Chen (eric-chen)
Changed in charm-nrpe:
milestone: none → 22.08
Chi Wai CHAN (raychan96)
Changed in charm-nrpe:
status: Fix Committed → Fix Released
Linda Guo (lihuiguo)
Changed in charm-nrpe:
assignee: nobody → Linda Guo (lihuiguo)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.