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
LEARN ABOUT NETBSD
curses_border
CURSES_BORDER(3) BSD Library Functions Manual CURSES_BORDER(3)
NAME
curses_border, border, box, wborder -- curses border drawing routines
LIBRARY
Curses Library (libcurses, -lcurses)
SYNOPSIS
#include <curses.h>
int
border(chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br);
int
box(WINDOW *win, chtype vertical, chtype horizontal);
int
wborder(WINDOW *win, chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br);
DESCRIPTION
These functions draw borders around stdscr or around the specified window.
The border() function draws a border around stdscr using the characters given as arguments to the function. The ls, rs, ts and bs are the
characters used to draw the left, right, top and bottom sides, respectively. The tl, tr, bl and br are the characters used to draw the top-
left, top-right, bottom-left and bottom-right corners, respectively. If any of the characters have a text portion that is 0 then a default
alternate character set character is used for that character. Note that even though the text portion of the argument is 0, the argument can
still be used to specify the attributes for that portion of the border. The following table shows the default characters for each argument:
ls ACS_VLINE
rs ACS_VLINE
ts ACS_HLINE
bs ACS_HLINE
tl ACS_ULCORNER
tr ACS_URCORNER
bl ACS_LLCORNER
br ACS_LRCORNER
wborder() is the same as border() excepting that the border is drawn around the specified window.
The box() command draws a box around the window given in win using the vertical character for the vertical lines and the horizontal character
for the horizontal lines. The corner characters of this box will be the defaults as described for border() above. Passing characters with
text portion that is 0 to box() will result in the same defaults as those for border() as described above.
RETURN VALUES
Functions returning pointers will return NULL if an error is detected. The functions that return an int will return one of the following
values:
OK The function completed successfully.
ERR An error occurred in the function.
SEE ALSO
curses_attributes(3), curses_line(3)
STANDARDS
The NetBSD Curses library complies with the X/Open Curses specification, part of the Single Unix Specification.
HISTORY
The Curses package appeared in 4.0BSD.
BSD
August 12, 2002 BSD