Swap Usage

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
dbcummings
Posts: 130
Joined: Thu Dec 13, 2018 8:37 am

Swap Usage

Post by dbcummings »

Hello,

I am running the NCPA on my Nagios XI servers. Our swap usage on one of our servers has move to warning yesterday. I noticed that our swap usage is slow creeping up on our servers. However, I believe we have enough memory to accommodate the servers' needs. See the output of free -g below:

total used free shared buff/cache available
Mem: 125 3 2 3 118 117
Swap: 7 0 7

We restarted one server last week and it has not been consuming any swap since. Should we be doing something to manage the swap usage on these servers?
dbcummings
Posts: 130
Joined: Thu Dec 13, 2018 8:37 am

Re: Swap Usage

Post by dbcummings »

Just ran "vmstat -w 1". I am only seeing 0s in si and so columns. So, it doesn't appear like anything is currently being swapped in our out.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Swap Usage

Post by lmiltchev »

Can you show us the actual check run from the command line, along with the output of it?
Be sure to check out our Knowledgebase for helpful articles and solutions!
dbcummings
Posts: 130
Joined: Thu Dec 13, 2018 8:37 am

Re: Swap Usage

Post by dbcummings »

I have sent you a PM.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Swap Usage

Post by lmiltchev »

Your swap usage is greater than 5 % (5.10%), and since you are using "-w 5 -c 10" thresholds, you get a WARNING. When using the "-u" flag, this only sets the "display unit". It it NOT used in calculations. NCPA uses the "%", not the "gb". You can adjust your thresholds, keeping this fact in mind. Let us know if this helped. Thank you!
Be sure to check out our Knowledgebase for helpful articles and solutions!
dbcummings
Posts: 130
Joined: Thu Dec 13, 2018 8:37 am

Re: Swap Usage

Post by dbcummings »

I guess my question is whether we can regularly purge our SWAP space since it seems to incrementally grown and not shrink unless a service is restarted or the server is rebooted. We have plenty of memory. So, I don't think that Nagios is regularly/actively using swap space.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Swap Usage

Post by lmiltchev »

Perhaps you could use:

Code: Select all

swapoff -a && swapon -a
Read more on clearing swap space in Linux here:
https://www.tecmint.com/clear-ram-memor ... -on-linux/

Is this what you were looking for?
Be sure to check out our Knowledgebase for helpful articles and solutions!
dbcummings
Posts: 130
Joined: Thu Dec 13, 2018 8:37 am

Re: Swap Usage

Post by dbcummings »

Partly. I came across this article as well. I am mainly look at if there are any guidelines around Nagios XI and swap. If I manage it and clear it using a post like this, will there be any negative impact.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Swap Usage

Post by lmiltchev »

The swap is managed by the operating system, not by Nagios XI. We do not know what the exact impact of removing the swap on your system is going to be. This is "operating system related" and not specifically related to Nagios XI. Also, we don't have any guides/documents in regards to this topic.
Be sure to check out our Knowledgebase for helpful articles and solutions!
dbcummings
Posts: 130
Joined: Thu Dec 13, 2018 8:37 am

Re: Swap Usage

Post by dbcummings »

<facepalm>sigh</facepalm>

Ok. We can close this post.
Locked