FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Development

 
 
LinkBack Thread Tools
 
Old 12-24-2010, 09:45 PM
derleader __
 
Default Collecting data

>> > 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?
What are the benefits of the kernel module and daemon?

Peter

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-24-2010, 10:58 PM
Les Mikesell
 
Default Collecting data

On 12/24/10 4: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?

What do you plan to do with the data? On the local host most is already
available through the /proc interface (things that look like files to user
programs) and tools already exist to read and display the values. If you want
to collect data from remote hosts, snmp is the appropriate protocol and again,
tools already exist.

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

Normally kernel modules would only be used to communicate with specific hardware
(and errors introduce the risk of crashing). Everything you mention is already
available without kernel changes, although some might be reported in less than
optimal ways.

--
Les Mikesell
lesmikesell@gmail.com
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-24-2010, 11:14 PM
John R Pierce
 
Default Collecting data

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)
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-25-2010, 05:12 AM
Paul Daggett
 
Default Collecting data

*I think Hugo's point is that there are much easier ways to extract the information you require without bloating the your kernel. It sounds like a shell script either in Bash or Perl calling the userland functions is the best way to go. "vmstat", "uptime", "top" and "who" could be invoked and then parsed to provide an easy way to return much of the information you indicate is required. I have to echo the thoughts of Alan that posting to General is a better forum for these sorts of questions.
*-Paul






From: derleader __ <derleader@abv.bg>
To: The CentOS developers mailing list. <centos-devel@centos.org>
Sent: Fri, December 24, 2010 10:05:01 AM
Subject: Re: [CentOS-devel] Collecting data

>I have a hard time trying to figure out why you would want to write a kernel module for all >of this. There are userland tools that can do just about everything you describe.

I know that there are many tools. This C program is developed with special task. Can you help me?

Regards
Peter









_______________________________________________
CentOS-devel mailing list
CentOS-devel@centos.org
http://lists.centos.org/mailman/listinfo/centos-devel
 
Old 12-25-2010, 02:54 PM
Clint Byrum
 
Default Collecting data

On Fri, 2010-12-24 at 12:28 -0600, C de-Avillez wrote:
> On 12/24/2010 09:29 AM, derleader __ wrote:
> > Hi,
> > I'm developing C plugin for Ubuntu Server which will be
> > installed as kernel module. The problem is how to collect the data
> > about:
> > 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
>
> Isn't something similar already done by collectd [1]? Would it be
> better to improve collectd as needed instead of writing a kernel
> module (and starting from scratch)?
>

Indeed, collectd is really the way to go for this. Also sysstat, which
has been around a long long time, also does most of this.



--
ubuntu-server mailing list
ubuntu-server@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-server
More info: https://wiki.ubuntu.com/ServerTeam
 
Old 12-26-2010, 01:39 AM
Charlie Brady
 
Default Collecting data

On Fri, 24 Dec 2010, Paul Daggett wrote:

> I think Hugo's point is that there are much easier ways to extract the
> information you require without bloating the your kernel. It sounds like
> a shell script either in Bash or Perl calling the userland functions is
> the best way to go.

collectd probably already does an excellent efficient job. But this is all
still off-topic for this list.
_______________________________________________
CentOS-devel mailing list
CentOS-devel@centos.org
http://lists.centos.org/mailman/listinfo/centos-devel
 

Thread Tools




All times are GMT. The time now is 05:16 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org