Hi, I started working on a sysctl plugin but never got that far. Just curious, why did you go with sysctlnametomib() versus sysctlbyname()?
Thanks Kimo ----- Original Message ---- > From: Toni Ylenius <[email protected]> > To: [email protected] > Sent: Tue, May 31, 2011 2:16:18 AM > Subject: [collectd] [PATCH] Simple sysctl plugin > > Hi, > > I have written a simple sysctl plugin. > > Initially I wanted to create a general sysctl plugin, but I ended up writing > a > > simple plugin that reads integer values from sysctl. The plugin relies on > the > sysctlnametomib function (that is very similar to the sysctlnametomib) and > should work on BSD like systems (Mac OS X?). I have tested the plugin only > on > FreeBSD. > > For example one can get temperature statistics with > <Plugin sysctl> > Instance "coretemp" > <Entry "dev.cpu.0.temperature"> > Type "fbsd_temp" # Real value = (fbsd_temp - 2732)/10.0 > Instance "cpu-0" > </Entry> > <Entry "dev.cpu.1.temperature"> > Type "fbsd_temp" > Instance "cpu-1" > </Entry> > </Plugin> > > or ZFS arc statistics (like the ZFS ARC plugin) > <Plugin sysctl> > Instance "zfs-arc" > <Entry "kstat.zfs.misc.arcstats.size"> > Instance "arc_size" > Type "gauge" > </Entry> > <Entry "kstat.zfs.misc.arcstats.l2_size"> > Instance "l2_size" > Type "gauge" > </Entry> > ... etc ... > </Plugin> > > This plugin has proven useful for me and I wanted to share it. However it > currently supports only integer sysctl values. A patch in the attachment is > against collectd version 5.0.0. > > I'm quite new in open source contribution, so feel free to comment my code. > > Toni Ylenius > _______________________________________________ collectd mailing list [email protected] http://mailman.verplant.org/listinfo/collectd
