[CentOS] Collecting data

Sat Dec 25 00:14:40 UTC 2010
John R Pierce <pierce at hogranch.com>

On 12/24/10 2:45 PM, derleader __ wrote:
>
> >> > Hi,
> >> > I'm developing C plugin for Centos which will be installed as
> >> > kernel module. The problem is how to collect the data about:
>
>
> > none of that stuff should be in a kernel module. a simple daemon is far
> > more appropriate.
>
> What is the most appropriate way to do this task?

see my prior response.  A daemon is simply a usermode process thats 
started when the system boots and runs as a dedicated service.   In 
CentOS, these are normally started via init.d scripts and the Sys V init 
subsystem.

but as others have pointed out there are numerous implementations of 
this already.     Also, in addition to the programmatic data sources I 
mentioned, much of the more realtime sort of data (cpu load, network 
traffic, etc) is available via SNMP which can be queried over a network 
from a data collection server, once its configured.

I wouldn't query the more 'inventory' sorts of data more than once a 
day, the number of CPUs and the hardware doesn't change very often, 
recording this every 5 minutes would be excessive.

> What are the benefits of the kernel module and daemon?

I know of no benefits of using a kernel module to perform what is 
readily doable in usermode.   kernel modules should be reserved for 
things like device drivers, low level network components, file systems, 
and so forth.    If a kernel module faults, it brings down the whole 
system catastrophically.  a usermode daemon process would just 
terminate, and everything else would continue running.      A daemon can 
run as whatever security context is appropriate for it to do its job.  
Most of what you described doesn't even need root privileges, but some 
may (lshw I believe won't be able to collect as much info if its not run 
as root)