[collectd] processes plugin on OpenBSD

Florian Forster octo at verplant.org
Wed Aug 20 10:09:11 CEST 2008


Hi Michael,

On Tue, Aug 19, 2008 at 02:35:24PM +0200, Michael Stapelberg wrote:
> * [19.08.08 10:04]:
> > the configure script now checks for the `kvm_getprocs',
> > `kvm_getswapinfo', and `kvm_nlist' functions and basically treats them
> > as different libraries. If everything works as expected, the
> > `processes', `swap', and `tcpconns' plugins should now be automatically
> > enabled if the kvm library provides the necessary functions.
> Not differently enough, it seems. I now get the following errors:
> processes.c: In function `ps_read':
> processes.c:1215: error: structure has no member named `ki_pid'

well, it just checks if the `kvm_getprocs' symbol is exported or not.
But fortunately this is a different issue than the tcpconns stuff, so I
take it that works?

Regarding that `processes' problem: The `kinfo_proc' structure
apparently is declared differently on OpenBSD. It's member `kp_proc' is
of type `struct proc', which holds all the information we need.

Reference:
- struct kinfo_proc
  <http://fxr.watson.org/fxr/source/sys/sysctl.h?v=OPENBSD#L303>
- struct proc
  <http://fxr.watson.org/fxr/source/sys/proc.h?v=OPENBSD#L151>
- struct pstats
  <http://fxr.watson.org/fxr/source/sys/resourcevar.h?v=OPENBSD#L44>
- struct rusage
  <http://fxr.watson.org/fxr/source/sys/resource.h?v=OPENBSD#L55>
- struct vmspace
  <http://fxr.watson.org/fxr/source/uvm/uvm_extern.h?v=OPENBSD#L387>

Escpecially `struct rusage' is interesting, because it really does
provide *a lot* of statistics about a process, such as:
- block input/output operations
- messages sent/received
- signals received
- in-/voluntatily context switches

> Furthermore, it still doesn't enable the cpu-module by default.

The CPU plugin can't natively work with OpenBSD. Is the `statgrab'
library detected corretly?

Regards,
-octo
-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080820/c316c01a/attachment.pgp 


More information about the collectd mailing list