Check Swap in/out rate instead of percentage free?

up at 3.am up at 3.am
Tue Aug 2 22:57:33 CEST 2011


> 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 am new to the list, so sorry if this is out of order...you should be able to
write a plugin using mostly what you have above, without outputting to a file...I
think this would do it (replace 100 with the number of pages you want as a
threshold):

-----
#!/bin/bash

PAGES=`grep pswpout /proc/vmstat | cut -d " " -f2`

  if [ $PAGES -gt 100 ]; then
     echo "Swapping $PAGES pages ALERT"
     exit 1
  fi

echo "Swapping $PAGES pages OK"
exit 0
-----

Now if anybody has any clue as to my LDAP/xinetd question, I would be very
grateful! :)

------------------------------------------------------------------------------
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
_______________________________________________
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