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 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
On Fri, 24 Dec 2010, derleader __ wrote:
To: centos@centos.org From: derleader __ derleader@abv.bg Subject: [CentOS] 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: 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?
Check this out.
It compiles the sort of thing you're doing into a loadable dynamic kernel module, that loads without having to do a reboot.
Name : systemtap Arch : i386 Version : 1.1 Release : 3.el5_5.3 Size : 6.3 M Repo : installed Summary : Instrumentation System URL : http://sourceware.org/systemtap/ License : GPLv2+ Description: SystemTap is an instrumentation system for systems running Linux 2.6. : Developers can write instrumentation to collect data on the operation : of the system.
Kind Regards,
Keith Roberts
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,
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.