Operating System - HP-UX
1753993 Members
7326 Online
108811 Solutions
New Discussion юеВ

monitor cpu's status with programming

 
SOLVED
Go to solution
jerryqin_1
Occasional Contributor

monitor cpu's status with programming

I'm a new comer.my question is how to write a C program to monitor cpu's status under HP-UX.

thanks,

Jerry
9 REPLIES 9
Geoff Wild
Honored Contributor
Solution

Re: monitor cpu's status with programming

Not too sure what you want - or why do it in C....

cpu stats available with built in HP-UX:

vmstat
top
glance

Do a man on those fore usage - easy to write a script to gather info.


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
jerryqin_1
Occasional Contributor

Re: monitor cpu's status with programming

Hi Geoff, thanks for your reply.
I want to write one C program to monitor the status of system resources, such as CPU, memory,disk,ect.
I wonder what tools I should choose, SIM, Sight manager, Service control manager or others.

Bds
Jerry
HGN
Honored Contributor

Re: monitor cpu's status with programming

Hi

HPUX has built in features for resource monitoring like top,vmstat,glance. There are also third party softwares which are available in the market.

Glance gives detailed output about the resource usage.

Rgds

Gopi
Victor BERRIDGE
Honored Contributor

Re: monitor cpu's status with programming

Hi,
If you are into C, and wish to write some C code then do a:
man pstat
You will find all you need...


Good luck
Victor
Victor BERRIDGE
Honored Contributor

Re: monitor cpu's status with programming

P.S.
look also at sar...
man sar

All the best
Victor
jerryqin_1
Occasional Contributor

Re: monitor cpu's status with programming

any C examples for reference ?

Bds
Jerry
Steven E. Protter
Exalted Contributor

Re: monitor cpu's status with programming

gtop is an open source tool for Linux. Its written in C or C++.

You can go get the source code and port it to HP-UX.

The reason people are recommending other tools, sar, top etc is the standard "been there done that got the tee-shirt" argument.

Most sysadmins see little reason to re-invent the wheel.

There may be some useful tools at http://www.hpux.ws/merijn

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Geoff Wild
Honored Contributor

Re: monitor cpu's status with programming

Well - here's one I found on ITRC - that does memory - maybe you can look at it and write one for cpu.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
jerryqin_1
Occasional Contributor

Re: monitor cpu's status with programming

Thanks you all very very much.

Best Wishes,
jerry