Operating System - HP-UX
1838240 Members
3380 Online
110125 Solutions
New Discussion

Extracting Load Average Stats in realtime

 
SOLVED
Go to solution
Grant Spencer
Advisor

Extracting Load Average Stats in realtime

I am trying to get load average times and process status on an HP box in
realtime without using system calls.

On Linux I can simply read from
/proc/loadavgs and /proc/[pid]/status. HP does not have the equivalent proc directory so was wondering whether there is some other method.

The info needs to be obtained quickly and frequently so starting external processes
and waiting for signals (e.g. launching top or uptime) are unsuitable.
If at first you do succeed, try not to look so surprised!
5 REPLIES 5
Tim D Fulford
Honored Contributor

Re: Extracting Load Average Stats in realtime

MeasureWare (mwa). I think you need to buy it though

Tim
-
Grant Spencer
Advisor

Re: Extracting Load Average Stats in realtime

Tim,

Thanks for your prompt response. We actually run Measureware here, but the problem I have is that if I launch any command from within the calling program, the resulting delay from calling the external program is too great.

Maybe if I can extract the stats on a regular basis and just write them out to a flat text file, that might be enough to do the task - so rather than pulling the information out, it is already to hand.....not sure this is entirely elegant though as the coding then depends on an external process running to operate!
If at first you do succeed, try not to look so surprised!
Scott Robertson
Occasional Advisor

Re: Extracting Load Average Stats in realtime

On HP-UX you can use the uptime command. I have also included a C program which compiles with the base HP-UX compiler. HTH
*formally known as srobertson@bcbsga.com
Roger Baptiste
Honored Contributor
Solution

Re: Extracting Load Average Stats in realtime

Hi,

How about using Glance
in the advisory mode?
You can set up a syntax
file to monitor the info
you want and run glance
in the advisory mode.

For eg: (all on same line)
>cat > /tmp/glance_syntax << EOF
>PRINT " ",GBL_MEM_QUEUE," ",GBL_RUN_QUEUE, "
",GBL_NUM_CPU,GBL_CPU_TOTAL_UTIL," ", GBL_SWAP_SPACE_AVAIL_KB,"
",GBL_SWAP_SPACE_UTIL," ", GBL_MEM_PHYS,GBL_MEM_UTIL,"
",GBL_NFS_SERVER_READ_BYTE_RATE," ",GBL_NFS_SERVER_WRITE_BYTE_RATE
>EOF


(there are various other
parameters you can track.
You can find them in
the glance help file in
/opt/perf directory)
Run glance as follows:
>/opt/perf/bin/glance -iterations 300 -adviser_only -syntax $syntax >OUTPUTFILE

You can keep track of outputfile to see the load.

hope this helps
raj
Take it easy.
Grant Spencer
Advisor

Re: Extracting Load Average Stats in realtime

Thanks! I was totally unaware that it was possible to actually extract stats from glance - always thought it just provided realtime info without any possibility of capturing it!

I have had a play around with it and I'm fairly convinced this will do the job. Appears also to have minimal impact on performance aswell.

Thanks to everyone who responded!
If at first you do succeed, try not to look so surprised!