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

Ton Voon tonvoon at mac.com
Wed Aug 18 14:17:04 CEST 2004


Sean,

Our policy is to try and use system calls where possible, rather than 
parsing command line tools, so your idea is exactly what we are looking 
for. If you can get it to work on tru64, solaris and *bsd, then I'd be 
more than happy to commit. However, it may have to wait until 1.5 as 
1.4 is in an alpha state at the moment.

Ton

On 18 Aug 2004, at 22:05, sean finney wrote:

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





More information about the Devel mailing list