Operating System - HP-UX
1843685 Members
3455 Online
110223 Solutions
New Discussion

Basic Q #1: How to show memory

 
SOLVED
Go to solution
Trever Furnish
Regular Advisor

Basic Q #1: How to show memory

Ok, I've got a few questions that are going to make me feel rather foolish (and probably mean easy points for someone). :-)

First:

What's the best way to find the amount of physical memory installed in a system running hpux11.00? What I'm looking for is something with output in a consistent format, something like meminfo, free, or even vmstat on some systems (although I'm not grasping how to display total RAM using vmstat on hpux).

Caveat:

Certain methods are unacceptable:
- Grep'ing the output of dmesg for "Physical". Not acceptable because it is unreliable - the line in question may or may not be there in the output depending on how much other data there is to show and there may or may not be another occurance of that word in the output.

- Grep'ing for Physical in the syslog - unacceptable for the same reasons listed above.

- Using top, glance, gpm, etc - unacceptable because they're interactive, curses/X based tools and what I need is something I can use to pull the data into a script.
Hockey PUX?
11 REPLIES 11
harry d brown jr
Honored Contributor

Re: Basic Q #1: How to show memory

/opt/ignite/bin/print_manifest

shows about everything

live free or die
harry
Live Free or Die
Darrell Allen
Honored Contributor

Re: Basic Q #1: How to show memory

Hi Trever,

From James R. Ferguson's reply in:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x93f6a12d6d27d5118fef0090279cd0f9,00.html

echo "selclass qualifier memory;info;wait;infolog"|cstm | grep "Total Physical Memory"

Darrell
"What, Me Worry?" - Alfred E. Neuman (Mad Magazine)
Trever Furnish
Regular Advisor

Re: Basic Q #1: How to show memory

Thanks, guys. Those both work (I had ignored print_manifest because I thought it was static, but it picked up the addition of a processor so I guess it's dynamic). Still seems like this is something HP would provide a more straightforward, single-purpose means of looking up, but both of those certainly get the job done.
Hockey PUX?
Sanjay_6
Honored Contributor

Re: Basic Q #1: How to show memory

Hi Trever,

You can also try,

echo 'selclass qualifier memory;info;wait;infolog' |cstm >/tmp/meminfo.txt

more /tmp/meminfo.txt

Hope this helps.

Regds
Deshpande Prashant
Honored Contributor

Re: Basic Q #1: How to show memory

Hi
You might want to use the SysInfo script.

Check following link.


http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x1a6646ff9277d511abcd0090277a778c,00.html

Thanks.
Prashant Deshpande.
Take it as it comes.
Stefan Schulz
Honored Contributor

Re: Basic Q #1: How to show memory

Hi,

have you checked the tools sam uses? Try /usr/sam/lbin/getmem. This will show the installed RAM in MB.

I use this im my inventoryscript and it works fine for me.

Hope this helps

Regards Stefan
No Mouse found. System halted. Press Mousebutton to continue.
Tom Geudens
Honored Contributor
Solution

Re: Basic Q #1: How to show memory

Hi,
You could try this
echo phys_mem_pages/D | adb /stand/vmunix /dev/kmem
phys_mem_pages:
phys_mem_pages: 24576
A life ? Cool ! Where can I download one of those from ?
Trever Furnish
Regular Advisor

Re: Basic Q #1: How to show memory

Thanks, all. Using adb for this is about as exact as I could hope to get, so that one makes me a "completely happy camper". Several others worked too. The sam tool getmem did NOT work for me (maybe it takes some options I'm ignoring) - it reported "120" on a sys with 4GB. The sysinfo script also looks promising.

Thanks for everyone's help.
Hockey PUX?
MANOJ SRIVASTAVA
Honored Contributor

Re: Basic Q #1: How to show memory

Trever

Here is a basic c scripts which will give output as :



Memory Stat total used avail %used
physical 32764.0 13775.3 18988.7 42%
active virtual 6410.8 2646.3 3764.5 41%
active real 7351.8 2848.8 4503.0 39%
memory swap 26522.5 8940.3 17582.2 34%
device swap 3332.0 3332.0 0.0 100%


Just compile it using cc file name and you are good to go . ( I got this form the forum only ).I have attached it to the answer.

Manoj Srivastava
Anonymous
Not applicable

Re: Basic Q #1: How to show memory

aware that your question is already answered...
As you find "SysInfo" useful
you may want to check "cfg2html", too. [1]

pro: beside the version for hpux there are also collectors for aix, SunOS, SCO, linux, ...

con: "not supported", provided as is (however, enhancement requests are implemented pretty fast by [2])

[1] http://come.to/cfg2html
[2] http://groups.yahoo.com/group/cfg2html/
Fabrício Valeta
New Member

Re: Basic Q #1: How to show memory

Oh yes baby !!

Your program in C it??s more useful for me !!

It??s a substitute for Glance !!

[]??s