[Nagiosplug-devel] [patch] check_swap for NetBSD/OpenBSD

sean finney seanius at seanius.net
Wed Aug 18 14:12:08 CEST 2004


hi tom,

i've also been working on getting this working on tru64 unix,
but the change is more complicated and will take a little more time.
however, it's led me to finding something that you might find interesting:

tru64, provides a system call called swapctl(2), which you can use
among other things to get a list of swap devices and their statuses.
since swapon -s is ugly and would be complicated to parse (and i can't
find any better programs on the system), i'm going to try and implement
it via this syscall.

where this gets interesting is that solaris and *bsd also provide
this functionality, though the bsd functions differ slightly in
calling conventions.  linux doesn't provide this function, but
does provide sysinfo(2), which among other things returns
the total and free amounts of swap.

is there any reason not to use these syscalls?  i think it could
considerably clean up the code in question.  i'd be happy to do
the legwork myself on this, just let me know.


	sean


On Wed, Aug 18, 2004 at 09:36:16PM +0100, Ton Voon wrote:
> Sean,
> 
> This looks good, but I cannot test. I doesn't break anything on my 
> MacOSX system, so I've committed this to CVS now. Thanks.
> 
> Ton
> 
> On 14 Aug 2004, at 08:31, sean finney wrote:
> 
> >hey there,
> >
> >after taking a look to see how it was done with the swap/swapinfo
> >commands, i've added the functionality to the configure script
> >to detect the NetBSD/OpenBSD swapctl command and configure
> >itself accordingly.  i've kept the patch as minimal as possible
> >(basically copying what was done for swap/swapinfo in configure.in),
> >and it's based off of a cvs checkout from earlier this afternoon.
> >
> >fwiw, i've tested this on NetBSD macppc and i386, as well as
> >OpenBSD i386.
> >
> >
> >	sean
> ><configure.in-swapctl.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20040818/865fa909/attachment.sig>


More information about the Devel mailing list