Re: Collecting data
On Fri, Dec 24, 2010 at 16:41, derleader __ <email@example.com> wrote:
> I'm developing C plugin for Debian which will be installed as kernel
> module. The problem is how to collect the data about:
why a module? a user-space tool/script/deamon is not enough for your needings?
> CPU Check – Utilization, Model, Number of Cores
> RAM Check – Total Memory, Free Memory, Memory Load
> HDD Check – Number of physical HDDs, Number of logical partitions, Total
> space, Free space
> Running processes – Total number of processes
> Logs – system logs such as error logs
> System uptime
> Users logged in and last login – total list of users
> Total network connections
> Check hardware parts model and number
> The kernel module will check the status of the OS every 5 minutes. What is
> the most efficient way to collect these data?
all this information are already exposed into /proc filesystem (that's
a direct interface to kernel data structures) or by several "standard"
linux tools (like free, netstat, loadavg, etc etc). You can write a
script to parse those info and <do what you have to> (we do it this
Anyhow, this discussion is off-topic on debian-devel, and if you
really want to write a kernel module, it's better if you try to locate
a better forum for kernel development, where you will probably also
find information about kernel data structures to inspect.
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi