system statistics


 
Thread Tools Search this Thread
Top Forums Programming system statistics
# 1  
Old 05-29-2003
system statistics

i am currently using c functions such as getprocs and statsfs to obtain process information and filesystem information on machines running aix 4.3.3.0. (soon to be running aix5.1) is there a function available to access information similar to the information provided by a vmstat command? i also need to know how to do similar monitoring on sun and linux machines. is there somewhere i could go to learn more about these system monitoring tools? any help would be appreciated. thanks unix gurus!!

-smitty
# 2  
Old 05-29-2003
I don't know aix, but I can make some general comments. vmstat works by reading a kernel data structure twice but exactly one second apart. Then it figures out what happened during that second. Some versions of unix get use a pseudo driver called /dev/mem and get the data from there. There sometimes is a special system to get the data. vmstat has a particular problem because it must zero out a structure to implement the -z option.

There are various "free" versions of unix on the web, complete with source code. You can download a couple of versions of the vmstat source to look at.

But my advice is: don't do this. Invoke the system vmstat program and parse the output. Your code will be easier to maintain and much more portable if you do.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Any way to get process statistics?

Hi, Can someone advise what "generic" command can I use to show statistics of a process or a running script/process? For example, I want to know how many hours/minutes it's taken to run or has been running, how much CPU it used and how much memory it used or uses. I want to be able to... (2 Replies)
Discussion started by: newbie_01
2 Replies

2. Solaris

Anyone help to interpretate os statistics

Hi, Can anyone help me to explain following statistics of my unix box. /usr/sbin/swap -l swapfile dev swaplo blocks free /dev/dsk/c4 118,771 16 33560432 33319776 /dev/dsk/c4 118,763 16 33560432 33327184 /usr/sbin/swap -s total: 13429368k bytes allocated + 9830880k reserved =... (9 Replies)
Discussion started by: giteshtrivedi
9 Replies

3. Shell Programming and Scripting

Average and peak System statistics

Hi I need to find the average and peak values of cpu usage, memory usage, and the peak time of occurences..in addition to that i need disk usage (free and used ) and (average and peak or total in a day)number of dropped packets in a interface i have tried using netstat -d -I eri0 and the... (0 Replies)
Discussion started by: aemunathan
0 Replies

4. HP-UX

packets statistics

Hi there, are there any functions that can get the packets statistics on UNIX ? thanks. (2 Replies)
Discussion started by: Frank2004
2 Replies

5. UNIX for Advanced & Expert Users

Getting Socket statistics

Is there any way to get the file descriptor statistics of a socket file descriptor? I know that the fstat, stat system calls are for this purpose, but I want to know it there any way to get socket connection statistics for a file descriptor(like socket flags, connection type etc). Does /proc... (3 Replies)
Discussion started by: comp_wizard07
3 Replies

6. UNIX for Dummies Questions & Answers

file statistics??

Is there any command in Unix (HP-UX) which will give me the file statistics .. e.g I have a file called r001 if I created that file on 2nd of aug 2005 and till now I changed that file contents 10 times. So how will I get the history statistic(time & date) of file modification. (1 Reply)
Discussion started by: zing_foru
1 Replies

7. Shell Programming and Scripting

Analyze Statistics

I have a file which contains records in the format of 2006-08-25 12:06:13|ABC|93 2006-08-25 12:45:55|ABC|203 2006-08-25 01:48:19|DEF|156 2006-08-25 01:49:09|ABC|12798 2006-08-25 02:49:59|GHL|4109 2006-08-25 03:50:50|DEF|234 where the format is "arrive time"|"message type"|"processing... (3 Replies)
Discussion started by: mpang_
3 Replies

8. Programming

Server Statistics ?

I'm trying to write a C program to view server statistics such as: - server general information - CPU usage - memory usage - running processes Cany anybody gives me hints on those system calls ?? ps: I'm using Tru64 unix (6 Replies)
Discussion started by: Agent007
6 Replies
Login or Register to Ask a Question