On 6/13/06, <b class="gmail_sendername">Ton Voon</b> <<a href="mailto:tonvoon@mac.com">tonvoon@mac.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div style="">I'm keen on getting check_swap working well on Solaris, but it's hard getting a decent system to develop on.<div><br></div><div>Which version of the plugins are you using? I think you are using a pre-1.4
 version as we no longer use the swap -s routine.</div><div><br></div><div>Please try the snapshot at <a href="http://nagiosplug.sourceforge.net/snapshot" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://nagiosplug.sourceforge.net/snapshot</a>.</div></div></div></blockquote><div><br><br>Hi Ton,<br><br>Tried building the latest snapshot but it errors during the make with<br><br>make  all-recursive<br>make[1]: Entering directory `/usr/local/home/bohara/nagios-plugins-HEAD-200606051623'
<br>Making all in lib<br>make[2]: Entering directory `/usr/local/home/bohara/nagios-plugins-HEAD-200606051623/lib'<br>make  all-am<br>make[3]: Entering directory `/usr/local/home/bohara/nagios-plugins-HEAD-200606051623/lib'
<br>rm -f libcoreutils.a<br>false cru libcoreutils.a cloexec.o full-read.o full-write.o safe-read.o safe-write.o xalloc-die.o error.o getopt.o getopt1.o exitfail.o xmalloc.o mountlist.o fsusage.o regex.o<br>make[3]: *** [
libcoreutils.a] Error 1<br>make[3]: Leaving directory `/usr/local/home/bohara/nagios-plugins-HEAD-200606051623/lib'<br>make[2]: *** [all] Error 2<br>make[2]: Leaving directory `/usr/local/home/bohara/nagios-plugins-HEAD-200606051623/lib'
<br>make[1]: *** [all-recursive] Error 1<br>make[1]: Leaving directory `/usr/local/home/bohara/nagios-plugins-HEAD-200606051623'<br>make: *** [all] Error 2<br><br><br>Not really much to go on, any ideas?<br><br>Cheers<br>
<br>Ben <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div style=""><div>Ton</div><div><br><div></div><div><span class="e" id="q_10bccc938e2066da_1">
<div>On 13 Jun 2006, at 10:34, Ben O'Hara wrote:</div><br></span></div><div><blockquote type="cite"></blockquote></div><div><span class="e" id="q_10bccc938e2066da_3">On 6/13/06, <b class="gmail_sendername">Thomas Sluyter</b>
 <<a href="mailto:tsluyter@kilala.nl" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">tsluyter@kilala.nl</a>> wrote:<div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
 On 13 Jun, 2006, at 10:27, Ben O'Hara wrote:<br><br>> db5# swap -l<br>> swapfile             dev  swaplo blocks   free<br>> /dev/md/dsk/d20     85,20     16 2097392      0<br>><br>> db5# swap -s<br>> total: 3431360k bytes allocated + 34488k reserved = 3465848k used, 
<br>> 820608k available<br><br> From the man-page of "swap":<br>> The blocks column from swap -l reports:<br>> The swaplen  value  for  the  area  in  512-byte blocks.<br><br>Also from that man-page:<br>
 > The allocated column from swap -s reports:<br>> The  total  amount  of  swap  space in   bytes currently allocated<br>> for use as backing store.<br><br>So there's a discrepancy right there.<br><br>How could your swap partition be 
2.097.392 * 512 (about 1G) in size,<br>when you have a total of over 3.4G in use? Swap -l does indeed report<br>that there are zero blocks free... Odd.<br><br>Could it be that you defined a non-default block size when creating 
<br>the swap space? Something like ~2048 per block? Could be that "swap -<br>l" doesn't actually report the size in 512 blocks, but in the -real-<br>size blocks. If check_swap was relying on swap -l , then the<br>
 calculation would be off as well... Seems like this might be a bit of<br>a bug in Solaris' "swap -l" command?<br><br>Anywho, looking at my own systems the combination of "df -k" and<br>"swap -s" seems to be the more reliable way of telling the real swap 
<br>usage.<br><br>So instead of the output of "metastat" I'm more curious about the<br>output of "df -k". This should show the size for your swap device in<br>kB (look for /var/run)...<br><br>Now, if "df -k" supports your claim that swap space is 4G in size I'd 
<br>wager that check_swap was using the "swap -l" approach, while it<br>could be making better use of the "swap -s" way.</blockquote><div><br><br>Hi Thomas, thanks for the detailed reply.<br><br>df -k is showing 
<br><br>Filesystem            kbytes    used   avail capacity  Mounted on<br>swap                  810152      24  810128     1%    /var/run<br><br>Which seems to suggest swap is only 800MB with 1% used?<br><br>The source for check_swap has the following 
<br><br>#   ifdef sun<br>        if (!allswaps) {<br>                asprintf(&swap_command, "%s", "/usr/sbin/swap -s");<br>                asprintf(&swap_format, "%s", "%*s %*dk %*s %*s + %*dk %*s = %dk 
<br>%*s %dk %*s");<br>                conv_factor = 2048;<br>        }<br>#   endif<br><br><br>Which to me suggests that its using swap -s for its calculations?<br><br><br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
 There's more buginess in check_swap anyway... See below:<br>> JST $ ./check_swap -w 85% -c 95%<br>> Warning percentage should be more than critical percentage<br>> Usage:<br>> check_swap [-a] -w <used_percentage>% -c <used_percentage>% 
<br>> check_swap [-a] -w <bytes_free> -c <bytes_free><br>> check_swap (-h | --help) for detailed help<br>> check_swap (-V | --version) for version information<br>><br>> JST $ ./check_swap -w 15% -c 5% 
<br>> SWAP OK: 98% free (1360 MB out of 1391 MB) |swap=1360MB;208;69;0;1391<br>Meaning that the author got "used_percentage" mixed up with<br>"free_percentage"</blockquote><div><br><br>Hmm, maybe worth not using check_swap then! 
<br><br>Cheers<br><br>Ben <br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Cheers!<br><br><br>Thomas<br><br><br>_______________________________________________________ 
<br>Nagios Plugin Development Mailing List <a href="mailto:Nagiosplug-devel@lists.sourceforge.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Nagiosplug-devel@lists.sourceforge.net</a><br>Unsubscribe at 
<a href="https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel</a><br>::: Please include plugins version (-v) and OS when reporting any issue.
<br>::: Messages without supporting info will risk being sent to /dev/null<br></blockquote> </div><br><br clear="all"><br>-- <br>"A Scientist will earn a living by taking a really difficult problem and spends many years solving it, an engineer earns a living by finding really difficult problems and side stepping them" 
<br><br></span></div><div><p align="center">This message has been scanned for viruses by <a href="http://www.MailController.altohiway.com/" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">MailController
</a>.</p><div style="margin: 0px;">_______________________________________________________</div></div><div><span class="q"><div style="margin: 0px;">Nagios Plugin Development Mailing List <a href="mailto:Nagiosplug-devel@lists.sourceforge.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Nagiosplug-devel@lists.sourceforge.net</a></div><div style="margin: 0px;">Unsubscribe at <a href="https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel</a></div><div style="margin: 0px;">::: Please include plugins version (-v) and OS when reporting any issue.<span> </span></div><div style="margin: 0px;">::: Messages without supporting info will risk being sent to /dev/null
</div> </span></div><div></div><br></div></div>
</div></blockquote></div><br><br clear="all"><br>-- <br>"A Scientist will earn a living by taking a really difficult problem and spends many years solving it, an engineer earns a living by finding really difficult problems and side stepping them"