Check Swap in/out rate instead of percentage free?

Richard Clark noc at fohnet.co.uk
Tue Aug 2 21:36:54 CEST 2011


On 2 Aug 2011, at 15:58, "Wenig, Michael (IT/I4Z)" <
michael.wenig at ww-informatik.de> wrote:

Hi all,

We want to know when one of our servers is swapping as a swapping server is
a normally dead server :-)

Currently we have the "normal" swap checks which generates a warning when
more than 5% swap are used and a critical when more than 10% are used.

This works ok until one time someone needs a little bit of swap. The swap
gets used but never unused (as linux does not remove something as long it is
not needed). So we get warnings and criticals while just some parts of swap
are used but not "active" (in terms of it is actively read from).

I think it would be more sufficient to not monitor how much swap is in use
but to check if pages are read from swap in some period of time. Such as

warning: if some pages were read out of swap
critical: if in all of the last three measurement-periods pages were read

I can acces the "absolute" swap out-page count by e.g.

cat /proc/vmstat | grep pswpout | cut -d " " -f2

which gives me the number of pages swapped out since the last boot. So I
would need to save this to some file and read it back.

I searched for a plugin which already does this (or a similar) kind of check
but I did not found anything.

So now I am wondering:

- did I just miss a plugin
- do I think completely wrong and my opinion is bullshit?

So the questions:

- does this kind of check make sense?
- is there any plugin which does this already?

Apologies if you're already doing/aware of this:
Most Linux distros tend to have a default kernel swappiness setting of
between 40-60%. This is fine for a desktop, but for servers I tend to set
this to 0 - basically telling the kernel to only use swap if it really has
to.
another option (slightly hacky imo) is to periodically empty the swap in
times where free RAM is plentiful by using swapon/swapoff.


--
Richard Clark
richard at fohnet.co.uk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20110802/ec0903b3/attachment.html>
-------------- next part --------------
------------------------------------------------------------------------------
BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA
The must-attend event for mobile developers. Connect with experts. 
Get tools for creating Super Apps. See the latest technologies.
Sessions, hands-on labs, demos & much more. Register early & save!
http://p.sf.net/sfu/rim-blackberry-1
-------------- next part --------------
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null


More information about the Users mailing list