[Nagiosplug-help] check_swap on Solaris 9

Marc Belanger sun.jedi at gmail.com
Thu Jan 8 15:30:12 CET 2009


I have a solaris 9 server which I initially installed 1.4.9 plugins
on. I was looking to understand why check_swap was tripping thresholds
in Nagios, but not matching up with what the system is actually using.
Example:

root @ schultz: top -n | grep Memory
Memory: 4096M real, 68M free, 5556M swap in use, 3592M swap free
root @ schultz: swap -l
swapfile             dev  swaplo blocks   free
/dev/md/dsk/d20     85,20     16 12587696 1544544
root @ schultz: swap -s
total: 5645192k bytes allocated + 37104k reserved = 5682296k used,
3685512k available

Even vmstat seems to be different:
swap free
5999304 714344

root @ schultz: ./check_swap -V
check_swap (nagios-plugins 1.4.9) 1.59
root @ schultz: ./check_swap -av -w 10% -c 5%
SWAP OK - 13% free (752 MB out of 6146 MB)  [753
(13%)]|swap=752MB;614;307;0;6146

Thats pretty close to vmstat, but far from top and swap. Odd.

So I went to look at 1.4.13. First of all, I had to compile check_swap
separately, it was not compiled in the 'make' but the .c file was
there. It doesn't work correctly either. Same example, new version:

root @ schultz: swap -s
total: 5645232k bytes allocated + 37064k reserved = 5682296k used,
3685480k available
root @ schultz: ./check_swap -V
check_swap v1991 (nagios-plugins 1.4.13)
root @ schultz: ./check_swap -av -w 10% -c 5%
SWAP OK - 100% free (0 MB out of 0 MB) |swap=0MB;0;0;0;0

Well, THATS not good. Its not using vmstat (or if it is -- it's waaaay
off), and I'm not sure why 0/0=100% either.

I suppose the fact that it did not compile (1.4.13) by default should
tell me there is a problem. A truss did reveal a few "Err#2 ENOENT",
so it's probably safe to say the lib versions are wrong. For now, I'm
keeping the 1.4.9 version, but would like to understand how check_swap
derives its values before choosing which version to use, or if I need
to roll my own. Is there someone out there who knows and can share?

Thanks,
-Marc




More information about the Help mailing list