November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

TOTAL/USED/AVAILABLE memory in AIX

TOTAL/USED/AVAILABLE memory in AIX

 
#!/usr/bin/ksh
#memory calculator
um=`svmon -G | head -2|tail -1| awk {‘print $3’}`
um=`expr $um / 256`
tm=`lsattr -El sys0 -a realmem | awk {‘print $2’}`
tm=`expr $tm / 1000`
fm=`expr $tm – $um`
echo “\n\n———————–“;
echo “System : (`hostname`)”;
echo “———————–\n\n”;
echo “Memory Information\n\n”;
echo “total memory = $tm MB”
echo “free memory = $fm MB”
echo “used memory = $um MB”
echo “\n\n———————–\n”;
Save the above script in a file and execute it.

#vi mem_calci     —> paste the above script and save it
#chmod +x mem_calci   —> provide the execute permission
#./mem_calci     —> run the script

Sample output:

System : (Hostname)
———————–
Memory Information

total memory = 8126 MB
free memory = 6328 MB
used memory = 1798 MB
———————–

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>