Operating System - HP-UX
1834368 Members
2456 Online
110066 Solutions
New Discussion

Re: Get installed memory-size from HP-UX

 
SOLVED
Go to solution
Maximilian Voss
Occasional Contributor

Get installed memory-size from HP-UX

Hi guys,

I'm new to HP-UX and I'd like to know how may I retrieve the actual memory-size from HP-UX.
About 4 weeks ago, somebody told me to use /usr/sam/lbin/getmem, but when I've got a machine with more than 1 GB RAM, I get the value 72MB which is for sure wrong.
I talked to some guys and they told me to ask the kernel directly, but I have no idea how.
I have HP-UX V11.xx systems.
swapinfo shows me available memory, but not how many is installed.
Is there somebody who can help me?

Best Regards

Max
20 REPLIES 20
James R. Ferguson
Acclaimed Contributor

Re: Get installed memory-size from HP-UX

Hi Max:

This will show you the physical memory installed and the layout of the same:

# echo "selclass qualifier memory;info;wait;infolog" | cstm > /tmp/meminfo

Regards!

...JRF...
Florian Heigl (new acc)
Honored Contributor

Re: Get installed memory-size from HP-UX

You can either gather it from the kernel message buffer:

enter dmesg and look/grep for Physical memory

or, if You have the Support Tools installed using:

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


The second one works better in my opinion.
yesterday I stood at the edge. Today I'm one step ahead.
Victor BERRIDGE
Honored Contributor

Re: Get installed memory-size from HP-UX

Hi Max;
cat /var/adm/syslog/syslog.log|grep Physical


Good luck
Victor
Patrick Wallek
Honored Contributor

Re: Get installed memory-size from HP-UX

Actually swapinfo does NOT show you installed memory. It shows you the amount calculated for use as 'pseudo-swap' space. Have a look at the swapinfo man page for more info.

To see the number of DIMMs installed (this assumes you have diagnostics installed):

# echo "selclass qualifier memory; info ; wait ; infolog" | cstm

If you want to see total physical memory:

# grep physical /var/adm/syslog/syslog.log
Patrick Wallek
Honored Contributor

Re: Get installed memory-size from HP-UX

My last command should be:

# grep -i physical /var/adm/syslog/syslog.log
Andrew Belville
Occasional Contributor

Re: Get installed memory-size from HP-UX

dmesg will give it to you (if you still have the boot process in the buffer)

Glance will show you (press 'm' for memory information).

and this c code will tell you (original author not known):

#define _PSTAT64
#include
#include
#include

int main(int argc, char *argv[])
{
struct pst_static pst;

if (pstat_getstatic(&pst, sizeof(pst), (size_t)1, 0) == -1) {
perror("pstat_getstatic");
return 1;
}

printf("physical memory size %llu bytes\n",
(unsigned long long) pst.physical_memory * pst.page_size);

return 0;
}
V. Nyga
Honored Contributor

Re: Get installed memory-size from HP-UX

Hi,

for 11.11 and 11.0 it's:
echo "phys_mem_pages/D" | adb /stand/vmunix /dev/kmem|grep phys|tail -1|awk '{printf "%.0f Mb\n",$2/256}'

You can also see it when the machine boots up - it's displayed during the boot process.
Also you can see the single RAM DIMM's when you interrupt boot process and let display the memory.

HTH
Volkmar
*** Say 'Thanks' with Kudos ***
Maximilian Voss
Occasional Contributor

Re: Get installed memory-size from HP-UX

Hi guys,

thanks for your high-speed posting.
All the stuff you've posted doesn't work ;(
I don't get any result. Asking dmesg or syslog doesn't work, because they're flooded with errors of some software and the machine had it's last reboot some month ago ;(
I asked someone from openview and he told me, that it's possible to ask the kernel itsself, and he told me how, but I can't remember. And he's currently on vacation.

Bye

Max
Jannik
Honored Contributor
Solution

Re: Get installed memory-size from HP-UX

#!/bin/ksh

GetKernelSymbol()
{
echo "$1/D" | \
adb -k $hpux /dev/kmem | \
tr "\012" " " | \
read junk junk2 kval
}

hpux=/hp-ux
rev=$(uname -r | cut -d. -f2)
if ((rev > 9)); then hpux=/stand/vmunix ;fi
/bin/uname -a
GetKernelSymbol "processor_count"
print CPU Count: $kval
GetKernelSymbol "itick_per_tick"
let speed=kval/10000
print CPU Speed: $speed MHz

if ((rev > 10)); then
print CPU HW Support: `getconf HW_CPU_SUPP_BITS`-bit
print Kernel Support: `getconf KERNEL_BITS`-bit
GetKernelSymbol "memory_installed_in_machine"
else
GetKernelSymbol "physmem"
fi

let mb=kval*4/1024 # convert pages to MB
print RAM Size: $mb MB
jaton
Maximilian Voss
Occasional Contributor

Re: Get installed memory-size from HP-UX

Thanks Volkmar!
It works, and that was exactly the command he gave to me.
Lots of thanks guys for your help.

Best Regards

Max
Geoff Wild
Honored Contributor

Re: Get installed memory-size from HP-UX

And you can also compile this c program called memdetail...

Output like:

# memdetail
Memory Stat total used avail %used
physical 4088.0 2468.4 1619.6 60%
active virtual 5475.0 724.3 4750.7 13%
active real 1450.5 280.2 1170.3 19%
device swap 20480.0 5230.0 15250.0 26%


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.
Florian Heigl (new acc)
Honored Contributor

Re: Get installed memory-size from HP-UX

You should definitely install the Support Tools, without it You don't have hardware monitoring and problems might go unnoticed.

Florian
yesterday I stood at the edge. Today I'm one step ahead.
I.Delic
Super Advisor

Re: Get installed memory-size from HP-UX

hi,

use

dmseg | grep memory


idriz
Alan Meyer_4
Respected Contributor

Re: Get installed memory-size from HP-UX

If you got the answers you were looking for, throw some points at these fine people. They put in some time and effort to give you the answer.

Every response to your question is eligible to earn between 1-10 points. No need to worry about running out of points - when a truly awesome reply rolls in that deserves a 10, you will be able to assign it a 10! However, be careful to assign points based on the value that a reply truly provides. Use the following scale as a guideline:



o N/A: The answer was simply a point of clarification to my original question

o 1-3: The answer didn't really help answer my question, but thanks for your assistance!

o 4- 7: The answer helped with a portion of my question, but I still need some additional help!

o 8-10: The answer has solved my problem completely! Now I'm a happy camper!


Although assigning points is not mandatory, it is a key component of a strong, interactive community, and it is STRONGLY ENCOURAGED. Others have taken time to help you, so please take a moment to give them credit for their assistance!
" I may not be certified, but I am certifiable... "
Trevor Alborough
New Member

Re: Get installed memory-size from HP-UX

Try this:

grep Physical /var/adm/syslog/syslog.log
Hoang Chi Cong_1
Honored Contributor

Re: Get installed memory-size from HP-UX

If you have installed the Support Tool Manager, you can use this command:
echo "sc qualifier memory;info;wait;infolog" | cstm

Regard,
Hoang Chi Cong
Looking for a special chance.......
Mahesh Kumar Malik
Honored Contributor

Re: Get installed memory-size from HP-UX

Hi Max

Use following command to get physical memory available in hp-ux server:

#dmesg |grep "Physical"

Regards
Mahesh
V. Nyga
Honored Contributor

Re: Get installed memory-size from HP-UX

Comon boys - can' you read:
dmesg or syslog doesn't work for Max!

@Max - maybe you should close the thread now ...

V.
*** Say 'Thanks' with Kudos ***
Bill Hassell
Honored Contributor

Re: Get installed memory-size from HP-UX

The simplest method is sam. Just start sam and select:

Performance Monitors -> System Properties


Bill Hassell, sysadmin

Re: Get installed memory-size from HP-UX

Simplify all your request in the forum Max.I like "Bill" advise.All have missed the first initial point.. You are new to it HP-UX. Great O/S btw..Here an easy way to get all information regarding all resources attached, configured or assigned. SAM will become your best bet in any and all operation as well. SAM is forgiving..I hesitate to say this and will tell you if you are about to step on it and does alot under the covers for you. IF by change you are fimiluar with print_manifest it too is very informative cd /opt/ignite/bin
run ./print_manifest Get Admin Book and a test server and have at it...

Those who forget the past are destined to re-live it