Category5.TV Community Forum

Full Version: Monitoring swap space
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have NEMS 1.5 running on my Raspberry Pi and all of a sudden I am getting critical errors to due to lack of swap space from my other raspberry pi's (running both raspian and DietPi). If I run the command on my NEMS server:

 /usr/local/nagios/libexec/check_swap -w 20 -c 10 pihole

I get:

SWAP OK - 1% free (0 MB out of 99 MB) |swap=0MB;0;0;0;99


i.e. swap space is OK but there isn't much free! However if I log in to the raspberry pi server and type

free

I get:
              total        used        free      shared  buff/cache   available
Mem:         949448      135012      562460       36684      251976      727408
Swap:        102396           0      102396

i.e. there is 100% free!

Any idea what is wrong?

  Andrew

PS The other odd thing is that when I get critical errors, they occur at exactly the same time for both raspberry pis
Robbie's answer from an earlier post:

(03-29-2018, 08:22 AM)Robbie Ferguson Wrote: [ -> ]I'd suggest just removing Swap from your Linux Servers group.

It's not accurate on a Pi because Pi only has 1 GB RAM and we don't allow it to swap to the SD card. So when RAM gets full, it takes a moment to compress the RAM (thereby creating swap via ZRAM) and hence the Nagios warning.

It's not a warning to worry about at all. The RAM / ZRAM (and thereby swap) are managed by the system... but because of the Pi's lousy RAM specs, you do end up hitting the cap every now and again  :)


Robbie
Thanks!

This has only started to occur recently so I didn't look too far back in the archives.

Have taken your and Robbie's advice and removed it :-)

  Andrew
I too had this problem and have taken Robbie's advice and removed swap from linux servers group.
RT