[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FYI: monitoring OpenBSD



Artur Grabowski <art@blahonga.org> writes:

> Willem Dijkstra <wpd@xs4all.nl> writes:
> > - mon: a small daemon that performs the actual measurements. mon needs
> >   priviledges to access kernel mem as the interface and io probes are
> >   via kvm_read. mon has been kept small as a direct result of this.
> 
> Any reason why those measurements can't be done through sysctls?

None whatsoever. I wanted to see how people reacted to the software before
taking drastic steps (for me, at least) as changing the kernel.  I'm actually
quite keen on this, as this would allow the monitor to run as nobody instead of
root.

I lifted the interface gathering from netstat, and remember mouthing "no shit"
when I saw how it got it's data. Making appropriate sysctls could be a start to
remove sgid kmem from it. Removing it alltogether is going to require some
serious work as there are 70+ kread's in that little
program. (s/netstat/vmstat/ for io statistics gathering)

> Just give me a list of information you need and I'll implement sysctls
> for it. Reading /dev/kmem is never a good idea, we're trying to move away
> from that.

For interface statistics I grab the ifdata for an interface and read
(if_ipackets, if_opackets, if_ibytes, if_obytes, if_imcasts, if_omcasts,
if_ierrors, if_oerrors, if_collisions, if_iqdrops).

For the io statistics I grab (dk_xfer, dk_seek, dk_bytes) from the 'disk'
structure.

Cheers,
Willem