Operating System - HP-UX
1826424 Members
3442 Online
109692 Solutions
New Discussion

Monitoring Physical Memory usuage ?

 
SOLVED
Go to solution
rveri
Super Advisor

Monitoring Physical Memory usuage ?

Hi All ,

I want to monitor the physical memory usuage on N4000-55 server , over 24 hours.

Can anyone suggest any good script or command.

Thanks ,
Veri.
12 REPLIES 12
Alan Meyer_4
Respected Contributor

Re: Monitoring Physical Memory usuage ?

I'm using glance in adviser mode in a cron script called util.sh.

util.sh
----------------------------------------------
DA=`date '+%m'`
/opt/perf/bin/glance -adviser_only -iterations 2 -syntax /root/util.fmt |grep "^$DA" |tail -1 >>/tmp/stats/util_stats.dat
----------------------------------------------

the fmt file looks like this

util.fmt
----------------------------------------------
print gbl_statdate, "-", gbl_stattime, gbl_cpu_total_util, gbl_mem_util, gbl_swap_space_util
----------------------------------------------

then I can place the output file into excel and graph it.
" I may not be certified, but I am certifiable... "
Alan Meyer_4
Respected Contributor
Solution

Re: Monitoring Physical Memory usuage ?

oops, left something out...

util.sh
----------------------------------------------
DA=`date '+%m'`
/opt/perf/bin/glance -adviser_only -iterations 2 -syntax /root/util.fmt 2>&1 |grep "^$DA" |tail -1 >>/tmp/stats/util_stats.dat
----------------------------------------------
" I may not be certified, but I am certifiable... "
rveri
Super Advisor

Re: Monitoring Physical Memory usuage ?

Thnks Alan,

Any one else want to add something ,
I want to get the physical memory usuage info in a report , to analyse later.

Thx.
DCE
Honored Contributor

Re: Monitoring Physical Memory usuage ?

Are the measureware agents running on the system? If so, you are already collecting the data you need.
Raj D.
Honored Contributor

Re: Monitoring Physical Memory usuage ?

Hi ,

Here is a similar script that can help ,

1. run the /home/cpumem/cpumem.sh file by cron.
--------------------------------------------------------


###########################################################################
# script for capturing CPU and Memory usuage over a period. 48 hours. #
# File Name: cpumem.sh #
# can be run throguh cron or script with nohup . #
# Files required: 1. cpumem.sh 2. cpumem.syn #
###########################################################################
cd /home/cpumem

echo "----------------------------------------------------------------------------------" >> cpumem.log
echo " Date: Time: (%)CPU Used: (%)Memory Used: " >> cpumem.log
echo "----------------------------------------------------------------------------------" >> cpumem.log

cd /home/cpumem
/opt/perf/bin/glance -adviser_only -j 15 -iterations 11520 -syntax /home/cpumem/cpumem.syn >> cpumem.log

echo " " >> cpumem.log
echo "----------------------------------------------------------------------------------" >> cpu_mem.log
echo "Monitoring of CPU and Memory done at `date` . " >> cpumem.log
echo "UPTIME= `uptime ` " >> cpumem.log
echo "----------------------------------------------------------------------------------" >> cpumem.log



2. File name: cpumem.syn [ not to put the two dotted lines ]
-----------------------------------------------------------------------------------------
print gbl_statdate, " ", gbl_stattime, " ", gbl_cpu_total_util, " ", gbl_mem_util
-----------------------------------------------------------------------------------------

Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
DCE
Honored Contributor

Re: Monitoring Physical Memory usuage ?


I forgot to mention how to get the data out of measureware -

One is PerfView - an added cost GUI. Another is to use the extract command. A
a man on extract will give you a good idea how extensive the data is.

You can customize the measure data collection in /var/opt/perf/parm. /var/opt/perf/datafiles is where MW stores its data

Raj D.
Honored Contributor

Re: Monitoring Physical Memory usuage ?

1.touch a file before that in the directory ,
cd /home/cpumem/
touch cpumem.log

2.Then tun the command cpumem.sh through cron.

------
The generated logfile will be cpumem.log

And will be looks like this:


----------------------------------------------------------------------------------
Date: Time: (%)CPU Used: (%)Memory Used:
----------------------------------------------------------------------------------
09/12/05 21:10:02 28.2 33.7
09/12/05 21:10:18 27.9 33.7
09/12/05 21:10:33 26.6 33.7
09/12/05 21:10:48 26.6 33.7
09/12/05 21:11:03 26.8 33.7
09/12/05 21:11:18 27.6 33.7
09/12/05 21:11:33 27.2 33.7
09/12/05 21:11:48 26.7 33.7
09/12/05 21:12:03 26.6 33.7
09/12/05 21:12:18 27.9 33.7
09/12/05 21:12:33 26.6 33.7
09/12/05 21:12:48 26.6 33.7
09/12/05 21:13:03 26.7 33.7
09/12/05 21:13:18 27.6 33.7
09/12/05 21:13:33 27.0 33.7
..
-----------------------------------------------------------------------------------

Cheers,
Raj
" If u think u can , If u think u cannot , - You are always Right . "
rveri
Super Advisor

Re: Monitoring Physical Memory usuage ?

Thanks Alan, Raj ,DCE

DCE,

How to run the extract command ,
any idea. I can see through # man extract

th.


Raj D.
Honored Contributor

Re: Monitoring Physical Memory usuage ?

The display is not proper , attached here with , it may help ,

Cheers,
Raj.
" If u think u can , If u think u cannot , - You are always Right . "
DCE
Honored Contributor

Re: Monitoring Physical Memory usuage ?

Unfortunately I am logged in without access to hpux will confirm syntax in am unless someone replies before then.

Dave
Raj D.
Honored Contributor

Re: Monitoring Physical Memory usuage ?

A little correction ,
cheers,
" If u think u can , If u think u cannot , - You are always Right . "
rveri
Super Advisor

Re: Monitoring Physical Memory usuage ?

thanks all , script with glance commands works fine. th.