Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
how can we get system information using c functions in any form of linux
I need to obtain information such as CPU,Mem utilization and statistics like type and brand of cpu ,number of nics connected to the system,nics type its mac address ,partitions/disk capacity,device idand its type ATA/SATA.I would like to know whether any pci cards are connected to my machine ....if yes its information. swap memory statistics .I would also like to know how to get events which occured ..is there any log file from which i can parse the events details.
Where can i get the above information from ,I dont wanna use the commands at the command prompt to get the information as this might slow my system down .I want to know if there is any directory which contains this information, like the /proc/cpu info file in ubuntu for cpu information etc .
Can u please help me out how to get the cpu and memory utilization for each and every process which is running on my machine.
i have to use some system calls or c functions inorder to do this .....can n e body help me out this ....i was able to find ioctl which would return ip address and mac address....can i use the same function to get information for all the above stated parameters.
I think most of this information is in the /proc directory, which can be read like any other directory, using functions like opendir and readdir. The statistics for each process are in /proc/PID_of_process. But your program will need to run with root permissions to access them.
__________________
"I'm just a little old lady; don't try to dazzle me with jargon!"
I think most of this information is in the /proc directory, which can be read like any other directory, using functions like opendir and readdir. The statistics for each process are in /proc/PID_of_process. But your program will need to run with root permissions to access them.
Solaris unlike the other Linux variants does not have files such as cpuinfo mem swaps files where we can get the information regarding the underlying system .All the files inside the /proc /PID_of_process are not in human readable format.I am looking at getting system level info across all the variants of linux
A Newbie's Getting Started Guide to Linux
Learn the basics of the Linux operating systems. Get to know what it is all about, and familiarize yourself with the practical side. Basically, if you're a complete Linux newbie and looking for a quick and easy guide to get you started this is it. subscribe
Open Source Security Myths Dispelled Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization subscribe
InformationWeek InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology. subscribe