<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">I'm keen on getting check_swap working well on Solaris, but it's hard getting a decent system to develop on.<DIV><BR class="khtml-block-placeholder"></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 class="khtml-block-placeholder"></DIV><DIV>Please try the snapshot at <A href="http://nagiosplug.sourceforge.net/snapshot">http://nagiosplug.sourceforge.net/snapshot</A>.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Ton</DIV><DIV><BR><DIV><DIV>On 13 Jun 2006, at 10:34, Ben O'Hara wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite">On 6/13/06, <B class="gmail_sendername">Thomas Sluyter</B> <<A href="mailto:tsluyter@kilala.nl">tsluyter@kilala.nl</A>> wrote:<DIV><DEFANGHTML_SPAN class="gmail_quote"></DEFANGHTML_SPAN><BLOCKQUOTE class="gmail_quote" defanghtml_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" defanghtml_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" defanghtml_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">Nagiosplug-devel@lists.sourceforge.net</A><BR>Unsubscribe at <A href="https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel"> 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><P align="center">This message has been scanned for viruses by <A href="http://www.MailController.altohiway.com/">MailController</A>.</P><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Nagios Plugin Development Mailing List <A href="mailto:Nagiosplug-devel@lists.sourceforge.net">Nagiosplug-devel@lists.sourceforge.net</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Unsubscribe at <A href="https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel">https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">::: Please include plugins version (-v) and OS when reporting any issue.<SPAN class="Apple-converted-space"> </SPAN></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">::: Messages without supporting info will risk being sent to /dev/null</DIV> </BLOCKQUOTE></DIV><BR></DIV></BODY></HTML>