10-17-2008
Script I wrote a while ago.
I cut/pasted below a script I used to use a long time ago to check the available memory on HP and SGI.
#!/bin/ksh
#
TMPFL=/tmp/showsys.tmp;touch $TMPFL
SCRIPTDIR=/scripts
case `uname -s` in
HP-UX*) #Machine type is HP HPUX
if [ `uname -m` = "ia64" ]; then
HPUX=/stand/vmunix
MAJORREV=$(uname -r | cut -f2 -d .)
if [ $MAJORREV -ge "11.0" ]; then MYSYMBOL="phys_mem_pages"; else MYSYMBOL="physmem"; fi
MEM=$(echo "${MYSYMBOL}" | adb $HPUX /dev/kmem | grep "${MYSYMBOL}: *." | awk '{printf "%.0fMB\n",$2/256}')
MHZ=$(echo itick_per_tick | adb $HPUX /dev/kmem | tail -1 | awk '{print $2/10000}')
else
HPUX=/stand/vmunix
MAJORREV=$(uname -r | cut -f2 -d .)
if [ $MAJORREV -ge "11.0" ]; then MYSYMBOL="phys_mem_pages"; else MYSYMBOL="physmem"; fi
MEM=$(echo "${MYSYMBOL}/D" | adb $HPUX /dev/kmem | grep "${MYSYMBOL}: *." | awk '{printf "%.0f MB\n",$2/256}')
MHZ=$(echo itick_per_tick/D | adb -k $HPUX /dev/kmem | tail -1 | awk '{print $2/10000}')
fi
;;
IRIX*) #Machine type is SGI Irix
hinv | grep -i mem>$TMPFL
MEM=`cat $TMPFL | awk '{print $4}'`;MTY=`cat $TMPFL | awk '{print $5}'`
hinv | grep MHZ>$TMPFL
MHZ=`cat $TMPFL | awk '{print $2}'`;
NCP=`cat $TMPFL | awk '{print $1}'`;
;;
AIX*) #Machine type is IBM AIX
MEM=`lsattr -El sys0 -a realmem -F value`
let MEM=$MEM/1024;MTY="Mbytes"
;;
SunOS*) #Machine type is Sun Solaris
echo "Do not know the commands for Sun maybe ask Joe"
exit 0
;;
*) #Machine type is Unknown
echo "Machine type is unknown"
exit 0
;;
esac
rm $TMPFL
echo "Main system memory is $MEM $MTY and $NCP CPU running at $MHZ mhz "
#
#End of script
10 More Discussions You Might Find Interesting
1. Filesystems, Disks and Memory
Hello:
Environment is: Oracle 817 on IBM RS/6000 AIX 433
I have 4GB RAM on the box and Page/Swap is about the same.
Presently I am using close to 1GB of RAM towards 5 instances of ORACLE production environments.
How can I know, how much of memory/RAM is used for :
Oracle Processes , I... (2 Replies)
Discussion started by: ST2000
2 Replies
2. UNIX for Dummies Questions & Answers
Hello Guys,
Please let me know about commands or tools that are available to check
memory leak in solaris box.
Thanks in Advance (1 Reply)
Discussion started by: rajeshlbryan
1 Replies
3. AIX
Hi,
As i am new to AIX,I have a problem one of my AIX box shows 100% memory utilization for a whole day.How to find the root cause..
Note : it is a DB2 8.1 DB server.
Please help Me!!:confused: (2 Replies)
Discussion started by: AIX_baby
2 Replies
4. UNIX for Dummies Questions & Answers
Hi all,
Unix has the TOP and SAR command to monitor machine's performance. Can it be used in a script to alert if the cpu utilization is more than 80 or memory used is more than 90.
Is SAR preferable than TOP?
Please advise. (3 Replies)
Discussion started by: er_ashu
3 Replies
5. Linux
Hi
I'be recently installed Virtouzzo on Centos 5 on 16GB box , but the system could only see 4 GB of RAM, I installed the package kernel-PAE, but the virtuozzo kernel still can't see the full memory.
even the kernel system can see 16GB of RAM
is there any idea bout that ?
Thanks (2 Replies)
Discussion started by: Raied
2 Replies
6. Solaris
I have certain questions.
1) How can i see the memory of the unix box.
2) How can i see the size of the database on the box
3)can anyone suggest an article or tutorial that explains the concept of
file systems and mount point in UNIX.
4)How can i see the dblink on the server
I... (5 Replies)
Discussion started by: asalman.qazi
5 Replies
7. Solaris
my system has 128G of installed memory. top, vmstat shows the system has just over 10G of free memory on the system. but as per prstat o/p the usage is just 50-55G is there anyway i can find which process/zone is using more memory ?
System has 3 zones and all running application servers.
... (1 Reply)
Discussion started by: fugitive
1 Replies
8. Solaris
I am working on Oracle 2 node RAC 10.2.0.4 on Solaris 10 T2000 kit.
The box has around 32G of memory of which 24G is used by oracle user. There is 3G of free memory on the box.
Sga max is set to 5G and while checking v$pgastat i see that maximum pga memory memory allocated was 6.5G. So oracle... (29 Replies)
Discussion started by: prabumohan
29 Replies
9. AIX
Hi,
monitor memory usage on AIX machine on any day of the week from 3:00 PM ET to 5:00 PM ET -
Povide min and max memory consumption.
Determine if all of the available memory is visible to the operating system. If it is not, determine the amount of memory which may be allocated to the... (3 Replies)
Discussion started by: Rookie_newbie
3 Replies
10. UNIX for Advanced & Expert Users
Being a moderator at openATV, a forum for Linux settup boxes, I have seen reports, and sometimes am experiencing myself, artefacts during video playback or timeshift.
As the artefacts are non repetetive (rewinding and watching again does not show artefacts), I can exclude a corrupted video source.... (23 Replies)
Discussion started by: Fischreiher
23 Replies
MEM(4) Linux Programmer's Manual MEM(4)
NAME
mem, kmem, port - system memory, kernel memory and system ports
DESCRIPTION
mem is a character device file that is an image of the main memory of the computer. It may be used, for example, to examine (and even
patch) the system.
Byte addresses in mem are interpreted as physical memory addresses. References to nonexistent locations cause errors to be returned.
Examining and patching is likely to lead to unexpected results when read-only or write-only bits are present.
It is typically created by:
mknod -m 660 /dev/mem c 1 1
chown root:kmem /dev/mem
The file kmem is the same as mem, except that the kernel virtual memory rather than physical memory is accessed.
It is typically created by:
mknod -m 640 /dev/kmem c 1 2
chown root:kmem /dev/kmem
port is similar to mem, but the I/O ports are accessed.
It is typically created by:
mknod -m 660 /dev/port c 1 4
chown root:mem /dev/port
FILES
/dev/mem
/dev/kmem
/dev/port
SEE ALSO
chown(1), mknod(1), ioperm(2)
COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
Linux 1992-11-21 MEM(4)