Monitoring swap space

Having issues? Post them here, and help other users.
Post Reply
arohl
Junior Member
Posts: 6
Joined: Sun Mar 17, 2019 8:10 am

Monitoring swap space

Post by arohl »

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
User avatar
Marshman
Member
Posts: 67
Joined: Fri Feb 02, 2018 5:33 pm
Location: New York, USA

RE: Monitoring swap space

Post by Marshman »

Robbie's answer from an earlier post:

[quote="Robbie Ferguson" pid='1185' dateline='1522326145']
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
[/quote]
Best regards,

MarshMan  NY, USA
arohl
Junior Member
Posts: 6
Joined: Sun Mar 17, 2019 8:10 am

RE: Monitoring swap space

Post by arohl »

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
ronjohntaylor
Member
Posts: 89
Joined: Sun Mar 18, 2018 12:02 am

RE: Monitoring swap space

Post by ronjohntaylor »

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