1833867 Members
2420 Online
110063 Solutions
New Discussion

finding info

 
khilari
Regular Advisor

finding info

Hi guys, i wanted to know how do u get to know how much memory an hp-ux system has. And also for network interface how do u find the speed and also if its duplex or not.Also, just want to confirm that the default route means the gateway right?. And lastly, netmask ffff8000 means 255.255.128.0 ?
Thanks
7 REPLIES 7

Re: finding info

HI Khilari,

U can use swapinfo command to view your memory in hpux.

same time you can use print_manifest to view complete machine configuration.

Note this option only works if ignite is installed. Try it out.

Regards
satish
DCE
Honored Contributor

Re: finding info


Ther are several ways to get the info you want

SAM
Glance
dmesg

all the above will give you a part of the info you want

You can also download and run sysinfo from the attached site. It will give you all of the info you want, plus more, in a nicely fornatted report

http://gatekeep.cs.utah.edu/hppd/cgi-bin/search?package=on&description=on&term=sysinfo&Search=Search
gstonian
Trusted Contributor

Re: finding info

You can use glance and go into the memory section (by bpressing m) to get the phyiscal memory

& yes netmask ffff8000 means 255.255.128.0
Reshma Malusare
Trusted Contributor

Re: finding info

Hi Khilari,
There are many ways through which you will get information about memory.Following are some commonly preferred ways:
1]glance --> by using glance command you can check for the memory.
2]swapinfo -->swapinfo prints information about device and file system paging space
By default, swapinfo prints to standard output a two line header as shown here, followed by one line per paging area:
o/p-->
Kb Kb Kb PCT
TYPE AVAIL USED FREE USED


START/ Kb
LIMIT RESERVE PRI NAME



3]dmesg -->gives you physical,available & lockable memory in kbytes

4]print_manifest

5]machinfo --> provides another mechanism for reporting the amount of physical memory.

Regards,
Reshma
Geoff Wild
Honored Contributor

Re: finding info

Here's a script for lancards:

# cat /usr/local/bin/lancards
#!/usr/bin/sh
# script to check speed and settings of lan cards
PATH=/usr/sbin:/usr/bin
ppas=`lanscan | awk '$3~/^[0-9]$/{print $3}' | xargs`
for i in $ppas
do
printf "Card at PPA %s - " $i
ipa=`ifconfig lan${i} 2>/dev/null | awk '{ip=$2}END{if(ip==""){printf("Not assigned")}else{printf("%s ",ip)}}'`
printf "IP Address: %15s- " "$ipa"
lanadmin -x $i 2>/dev/null | awk '{$1="";printf("%s",$0)}'
echo ""
done



and one for memory:

# cat /usr/local/bin/hpmem
#!/bin/ksh
#
# Taken from the HP/UniGraphics FAQ
# You must be ROOT to execute this since it uses adb to
# examine the running kernel
#
GetKernelSymbol()
{
echo "$1/D" | \
adb $hpux /dev/kmem | \
tr "\012" " " | \
awk -F: '{print $3}'|\
read kval
}
hpux=/hp-ux
rev=$(uname -r | cut -d. -f2)
if ((rev > 9)); then hpux=/stand/vmunix ;fi
/bin/uname -a
# if 11iv2 or higher - get cpu this way
ver=$(uname -r | cut -d. -f3)
if ((ver > 22)); then
kval=`echo "processor_count/D" | adb /stand/vmunix /dev/kmem |tail -1|awk -F: '{print $2}' `
else
GetKernelSymbol "processor_count"
fi
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
# if 11iv2 or higher - get memory this way
ver=$(uname -r | cut -d. -f3)
if ((ver > 22)); then
kernel=$(/usr/sbin/kcpath -x)
hexval=$(echo "phys_mem_pages/A" | adb $kernel /dev/kmem|tail +2|awk '{print $2}')
REAL_MEM=$(echo ${hexval}=D|adb)
mb=$(expr ${REAL_MEM} / 256)
else
let mb=kval*4/1024 # convert pages to MB
fi
print RAM Size: $mb MB
GetKernelSymbol "bufpages"
let mb=kval*4/1024 # convert pages to MB
print bufpages: $mb MB
GetKernelSymbol "maxuprc"
print maxuprc: $kval
GetKernelSymbol "maxvgs"
print maxvgs: $kval
GetKernelSymbol "maxfiles"
print maxfiles: $kval
GetKernelSymbol "max_thread_proc"
print max_thread_proc: $kval
GetKernelSymbol "nfile"
print nfile: $kval
GetKernelSymbol "nproc"
print nproc: $kval
GetKernelSymbol "ninode"
print ninode: $kval
GetKernelSymbol "vfd_cw"
print shmmax: $kval
GetKernelSymbol "shmmni"
print shmmni: $kval
GetKernelSymbol "dbc_max_pct"
print dbc_max_pct: $kval



Or you can compile the attached c program called memdetail.

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.
Arturo Galbiati
Esteemed Contributor

Re: finding info

Hi,
to get memeory info you can use this Perl script from EACH user:

# To get RAM size in KB
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";'


netmask ffff8000 means 255.255.128.0

HTH,
Art
Reshma Malusare
Trusted Contributor

Re: finding info

Hi,
Please read:
http://forums1.itrc.hp.com/service/forums/helptips.do?#33 on how to reward any useful answers given to your questions.