Operating System - HP-UX
1753803 Members
7862 Online
108805 Solutions
New Discussion юеВ

Finding RAM SIZE in HP-UX as a normal user???

 
SOLVED
Go to solution
muthukumaran13
New Member

Finding RAM SIZE in HP-UX as a normal user???

Am trying to find the total RAM SIZE of a HP-UX m/c as a normal user(not Super-User)..have tried some commands that I have got from forums...No help...Please help me out to find the total RAM SIZE(in MB) of a HP-UX m/c using a command...


Thanks in Advance..
Muthukumaran.M
12 REPLIES 12
Peter Godron
Honored Contributor

Re: Finding RAM SIZE in HP-UX as a normal user???

Hi,
if you have access to perl:
perl -e 'local($PSTAT,$PSTAT_STATIC,$mem_info,$PSTAT_STRUCT)=(239,2,"\0"x120,"LI4L");
syscall($PSTAT,$PSTAT_STATIC,$mem_info,length($mem_info),1,0);
print "RAM=".int((unpack($PSTAT_STRUCT,$mem_info))[4]*((unpack($PSTAT_STRUCT,$mem_info))[5])/(1024*1024))."\n";'
Borislav Perkov
Respected Contributor

Re: Finding RAM SIZE in HP-UX as a normal user???

Hi,

grep Physical /var/adm/syslog/syslog.log

and you get it in bytes

Regards,
Borislav
Borislav Perkov
Respected Contributor

Re: Finding RAM SIZE in HP-UX as a normal user???

ops Kbytes
Ninad_1
Honored Contributor
Solution

Re: Finding RAM SIZE in HP-UX as a normal user???

Hi,

You can also try this

echo "selclass qualifier memory;info;wait;infolog" | /usr/sbin/cstm

regards,
Ninad
muthukumaran13
New Member

Re: Finding RAM SIZE in HP-UX as a normal user???

Thanks gurus for all ur prompt reply...My machine has a 1GB RAM(1024MB)...But the perl command returned it as 1022MB(close call)...Also was curious to know whether it will (perl) with all HP-UX machines since it might be not be sometimes supported in some m/cs..or is it a in-built package of UX...

But the cmd

echo "selclass qualifier memory;info;wait;infolog" | /usr/sbin/cstm

worked like a charm

Basic Memory Description

Module Type: MEMORY
Total Configured Memory : 1024 MB
Page Size: 4096 Bytes

Memory interleaving is supported on this machine and is ON.

Memory Board Inventory

DIMM Slot Size (MB)
--------- ---------
0A 256
0B 256
1A 256
1B 256
--------- ---------
System Total (MB): 1024

...This is de part of o/p I have got but my problem is whether I have to take the one in
Basic memory description or the System total in Memory Board Inventory...Was jus inquistive to know whether they might differ or not..Please suggest..
Arunvijai_4
Honored Contributor

Re: Finding RAM SIZE in HP-UX as a normal user???

Hi Muthu,

You can take a look at these threads,

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1008114
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1011122

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Bill Hassell
Honored Contributor

Re: Finding RAM SIZE in HP-UX as a normal user???

Perl has been available in HP-UX for many years but (unsupported) versions of HP-UX may have the old Perl 4 version, or have both Perl 5 and 4 loaded at the same time. For HP-UX version 11-anything, Perl 5 is stadard.

cstm is part of the online diagnostics and normally installed by HP on every machine. However, some sysadmins either remove the diagnostics or reinstall HP-UX without them (neither is a good idea) which makes the cstm less portable. However, I would see the lack of cstm as a red flag and get it remedied. You can see an amazing amount of information through cstm:

CPU boards:
echo "selclass qualifier cpu;info;wait;infolog" | /usr/sbin/cstm

LAN cards:
echo "selclass qualifier lan;info;wait;infolog" | /usr/sbin/cstm

Memory:
echo "selclass qualifier memory;info;wait;infolog" | /usr/sbin/cstm

DIsks:
echo "selclass qualifier disk;info;wait;infolog" | /usr/sbin/cstm


Bill Hassell, sysadmin
muthukumaran13
New Member

Re: Finding RAM SIZE in HP-UX as a normal user???

So does that mean I can use that perl command without any further ado...or no harm in using
echo "selclass qualifier memory;info;wait;infolog" | /usr/sbin/cstm too...



muthukumaran13
New Member

Re: Finding RAM SIZE in HP-UX as a normal user???

Also while using the cstm command which one give you the RAM Size ..Basic memory description or the System total in Memory Board Inventory...Also plz let me know whether they might differ or not..

Thanks for all ur help so far :)