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, 02:41 PM
derleader __
 
Default Collecting data

Hi,

Β*Β*Β*Β* I'm developing C plugin for Debian 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

The kernel module will check the status of the OS every 5 minutes. What is the most efficient way to collect these data?



Regards

Peter
 
Old 12-24-2010, 03:39 PM
Bastian Blank
 
Default Collecting data

On Fri, Dec 24, 2010 at 05:41:12PM +0200, derleader __ wrote:
> The kernel module will check the status of the OS every 5 minutes. What is the most efficient way to collect these data?

apt-get install munin-node

Bastian

--
Star Trek Lives!


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20101224163914.GA27027@wavehammer.waldi.eu.org">ht tp://lists.debian.org/20101224163914.GA27027@wavehammer.waldi.eu.org
 
Old 12-24-2010, 03:43 PM
Sandro Tosi
 
Default Collecting data

Hi,

On Fri, Dec 24, 2010 at 16:41, derleader __ <derleader@abv.bg> wrote:
> Hi,
> Β*Β*Β*Β* 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
way).

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.

Regards,
--
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: AANLkTi=t-2+QO-i3JAVgxSWdgJMO14iDv4-Fn3v7M-0j@mail.gmail.com">http://lists.debian.org/AANLkTi=t-2+QO-i3JAVgxSWdgJMO14iDv4-Fn3v7M-0j@mail.gmail.com
 
Old 12-24-2010, 03:47 PM
Ben Hutchings
 
Default Collecting data

This list is for discussion of development *of* Debian, not *on* Debian.

On Fri, 2010-12-24 at 17:41 +0200, derleader __ wrote:
> Hi,
> I'm developing C plugin for Debian which will be installed as
> kernel module.

I would advise against doing that, as it will be easier to obtain this
information from userland.

> The problem is how to collect the data about:
> * CPU Check – Utilization, Model, Number of Cores

See /proc/stat (utilisation) and /proc/cpuinfo (the rest).

> * RAM Check – Total Memory, Free Memory, Memory Load

See /proc/meminfo.

> * HDD Check – Number of physical HDDs, Number of logical
> partitions, Total space, Free space

See /sys/block and the statvfs() system call.

> * Running processes – Total number of processes

See /proc.

> * Logs – system logs such as error logs

Kernel log is accessible using klogctl(). The general logs are
under /var/log and are configurable by the administrator.

> * System uptime

See /proc/uptime.

> * Users logged in and last login – total list of users

See manual page utmp(5).

> * Total network connections

See /proc/net/tcp, /proc/net/udp, etc.

> * Check hardware parts model and number

Some information is under /sys/devices/virtual/dmi/id. Otherwise look
at what the 'lshw' command does.

> The kernel module will check the status of the OS every 5 minutes.
> What is the most efficient way to collect these data?

Don't try to list the hardware every 5 minutes! The rest should be
fairly cheap to scan.

Ben.

--
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.
 
Old 12-24-2010, 03:58 PM
"Fabio T. Leitao"
 
Default Collecting data

Hello Peter,Β*
I believe most of the information you intend to collect are in the filesystem /proc (CPU, RAM, HDD, Processes, Uptime, Network, etc.) or the the /var/log/messages and maybe even the /etc/syslog.conf


Most applications (such as w and ipconntrac) probably read from there to show in the console what is stored there.
I am not sure if that is exactly what you were looking for, but if you are trying to read straight from the kernel variables, then when you read the source code I believe it would not be that difficult to figure out how the information get written there now that you have the actual destination in the filesystem.


You should also have a look ate the munin project, specially the plugins to collect data (every 5 minutes) which might help a lot teaching about where the gather these info.


2010/12/24 derleader __ <derleader@abv.bg>



Β*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
The kernel module will check the status of the OS every 5 minutes. What is the most efficient way to collect these data?

Regards
Peter



--

ubuntu-server mailing list

ubuntu-server@lists.ubuntu.com

https://lists.ubuntu.com/mailman/listinfo/ubuntu-server

More info: https://wiki.ubuntu.com/ServerTeam


--
FΓ‘bio LeitΓ£o
..-. .- -... .. ---Β* .-.. . .. - .- ---Β* ...-.-





--
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-24-2010, 05:27 PM
Bernd Zeimetz
 
Default Collecting data

On 12/24/2010 05:39 PM, Bastian Blank wrote:
> On Fri, Dec 24, 2010 at 05:41:12PM +0200, derleader __ wrote:
>> The kernel module will check the status of the OS every 5 minutes. What is the most efficient way to collect these data?
>
> apt-get install munin-node

or use collectd.

--
Bernd Zeimetz Debian GNU/Linux Developer
http://bzed.de http://www.debian.org
GPG Fingerprint: ECA1 E3F2 8E11 2432 D485 DD95 EB36 171A 6FF9 435F


--
To UNSUBSCRIBE, email to debian-devel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4D14E629.2040903@bzed.de">http://lists.debian.org/4D14E629.2040903@bzed.de
 
Old 12-24-2010, 05:28 PM
C de-Avillez
 
Default Collecting data

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)?

Cheers,

..C..


[1] https://launchpad.net/ubuntu/+source/collectd


--
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-24-2010, 06:26 PM
John R Pierce
 
Default Collecting data

On 12/24/10 7:01 AM, 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:
>
> *
>
> 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
>
>

none of that stuff should be in a kernel module. a simple daemon is far
more appropriate.

you can get the CPU info out of /proc/cpuinfo
you can get the ram info out of /proc/meminfo
you can get the HDD info from /bin/df
you can get the process info from /bin/ps
the logs are all in regular files as /var/log/***
the user login info can be found by parsing /var/log/wtmp
the network connections via /bin/netstat -an
the hardware info from lspci or lshw

thats a lot of redundant and voluminuous information to be fetching
every 5 minutes,



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-24-2010, 09:02 PM
Chris Jones
 
Default Collecting data

On Fri, 2010-12-24 at 16:37 +0200, derleader __ wrote:
> Hi,
> I'm developing C plugin for Red Hat 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
>
> The kernel module will check the status of the OS every 5 minutes.
> What is the most efficient way to collect these data?
>

Sounds like and interesting project actually. I'd like to follow your
development status for curiosity.

Regards


--
Chris Jones

PHOTO RESOLUTIONS - Photo - Graphic - Web
ABN: 98 317 740 240
@: chrisjones@comcen.com.au
WWW: http://photoresolutions.freehostia.com

_______________________________________________
Redhat-devel-list mailing list
Redhat-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/redhat-devel-list
 
Old 12-24-2010, 09:35 PM
Jure Pečar
 
Default Collecting data

On Fri, 24 Dec 2010 11:26:56 -0800
John R Pierce <pierce@hogranch.com> wrote:

> On 12/24/10 7:01 AM, 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.

Agree. Check out ganglia, collectd, cacti or any other of the miriad tools
already developed for this exact purpose.


--

Jure Pečar
http://jure.pecar.org
http://f5j.eu
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




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

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