Operating System - Tru64 Unix
1752577 Members
4333 Online
108788 Solutions
New Discussion юеВ

Re: system statistics

 
SOLVED
Go to solution
Ali Humaidan
Occasional Advisor

system statistics

Hi all,
I'm using Tru64 UNIX 5.1a and I'm trying to write a C program to get the different kind of system statistics such as:
- general server info
- memory usage
- cpu usage
- running processes

can anybody help me to find the C system calls for those info
12 REPLIES 12
Ralf Puchner
Honored Contributor

Re: system statistics

/proc is your friend. Have a look to older forum entries containing a sample reading values.
Help() { FirstReadManual(urgently); Go_to_it;; }
Ali Humaidan
Occasional Advisor

Re: system statistics

Thanks for your reply but can you be more specific ?
I know how to get these info from linux proc directory, but on unix everything is different, and it seems proc directory contains only process information
Ralf Puchner
Honored Contributor

Re: system statistics

the information about running processes/memory usage is part of a sample source code posted here in the forum.
Help() { FirstReadManual(urgently); Go_to_it;; }
Ali Humaidan
Occasional Advisor

Re: system statistics

Thanks Ralf for your reply
I searched the forums again and again with no use
I would really appreciate it if you can give me the direct link for this source code
Ralf Puchner
Honored Contributor

Re: system statistics

have a look into the attachement. prpsinfo structure is important.
Help() { FirstReadManual(urgently); Go_to_it;; }
Arnaud Veron
Valued Contributor

Re: system statistics

why don't you query the tru64 snmp agent ???
Ali Humaidan
Occasional Advisor

Re: system statistics

Thank you Ralf very much for the code, it has helped me in monitoring the process on the system.

But what about physical/swap memory usage and the disk I/O ??? can these information also be found in /proc directory or by communication to the server with SNMP or what ?
Ralf Puchner
Honored Contributor

Re: system statistics

these information can also be found within /proc and also within snmp.

Information for snmp can be found within the man pages and /usr/share/sysman/mibs.
Help() { FirstReadManual(urgently); Go_to_it;; }
Ali Humaidan
Occasional Advisor

Re: system statistics

Thanks Ralf Puchner and Arnaud Veron for your positive feedback.

It seems that mibs files contains all the info I need, but I don't know how to intereact with it using SNMP ??

Can anybody direct me to any C source code to intereact with SNMP agent on the server ??? (because I couldn't find any)