More and Vi (or) More Vi

To edit a file after looking at it with "more"
Press the letter "v" key and you will be placed
in a vi session.

Quitting the vi session will bring you back
to viewing the file with the "more" command

This will not work with piping a file to "more".

This works:

$ more /etc/hosts

This does not:

$ cat /etc/hosts | more

CLEANUP DOS FILES

If you deal with DOS files and the "^M" character
always appears at the end of the line, here are
two ways to get rid of them.

If you edit the DOS text file with the "vi" 
editor in UNIX, use the following from the 
"vi" command line:

:%s/^V^M//g

From a Unix shell use the command:

% sed 's/^V^M//g' pwlist.txt > pwlist.txt_new

NOTE:  ^V is control V and ^M is control M or Enter

awk ...

If you have a server with a lot of file systems on it. Then this little “awk” command can come in useful. It can obviously be used in many other situations also.

In this example, the disk group name is /homedg/.

bash-3.00$ grep homedg /etc/vfstab
/dev/vx/dsk/homedg/sanlogs      /dev/vx/rdsk/homedg/sanlogs     /var/log/sanlogs vxfs    1       yes     -
/dev/vx/dsk/homedg/common      /dev/vx/rdsk/homedg/common     /usr/local/common vxfs    2       yes     -
bash-3.00$

bash-3.00$ awk '/homedg/{print "mount -F "$4,$1,$3}' /etc/vfstab
mount -F vxfs /dev/vx/dsk/homedg/sanlogs /var/log/sanlogs
mount -F vxfs /dev/vx/dsk/homedg/common /usr/local/common
bash-3.00$


If you run it with piping it to 'sh', then it will execute the command. You can replace the 'mount' with whatever command you like.

FORGET THE CRONTAB MAN

For some reason many admins forget the field order of the crontab file and always reference the man pages over-and-over.
Make your life easy. Just put the field definitions in your crontab file and comment (#) the lines out so the crontab file ignores it.

#minute (0-59),
#|      hour (0-23),
#|      |      day of the month (1-31),
#|      |      |      month of the year (1-12),
#|      |      |      |      day of the week (0-6 with 0=Sunday).
#|      |      |      |      |      commands
  0    2     *      *      0,4    /etc/WorkSmart.sh


REGULAR EXPRESSION MATCHING IN AWK


If you ever find yourself typing :
# command | grep pattern | awk '{print $3}'

you can shorten this by using the regexp matching in awk, like this:
# command | awk '/pattern/{print $3}'

Check the VMware Tools time synchronization configuration details


Command to check status:
# vmware-toolbox-cmd timesync status
Disabled
#
If it is enabled, execute the below command and make it disable:
# vmware-toolbox-cmd timesync disable
Disabled

#

Command to check read only file system on Linux

Command to check read only file system on Linux:

$ cat /proc/mounts | grep ro,
/dev/root / ext3 ro,data=ordered 0 0
/dev/VolGroup00/LogVol06 /tmp ext3 ro,data=ordered 0 0
/dev/VolGroup00/LogVol02 /usr ext3 ro,data=ordered 0 0
/dev/VolGroup00/LogVol03 /usr/local ext3 ro,data=ordered 0 0
/dev/VolGroup00/LogVol07 /home ext3 ro,data=ordered 0 0
/dev/VolGroup00/LogVol05 /opt ext3 ro,data=ordered 0 0
/dev/sapwebvg/usrsapP35lv /usr/sap/P35 ext3 ro,data=ordered 0 0
$

$ cat /proc/mounts | grep ro,
/dev/loop1 /RHEL6.6_64 iso9660 ro,relatime 0 0
/dev/loop2 /RHEL7.1_64 iso9660 ro,relatime 0 0

$

Unable to get Virtual console on VMWare at runlevel 3(Redhat Linux).

Issue:
After reboot the Redhat Linux server we are getting the below message and console is hung.
INIT: no more processes left in this runlevel

Solution:
Please make sure the mingetty lines are un-commented on “/etc/inittab” file.

$ cat /etc/inittab | grep -v ^#

id:3:initdefault:
si::sysinit:/etc/rc.d/rc.sysinit
l0:0:wait:/etc/rc.d/rc 0
l1:1:wait:/etc/rc.d/rc 1
l2:2:wait:/etc/rc.d/rc 2
l3:3:wait:/etc/rc.d/rc 3
l4:4:wait:/etc/rc.d/rc 4
l5:5:wait:/etc/rc.d/rc 5
l6:6:wait:/etc/rc.d/rc 6
ca::ctrlaltdel:/sbin/shutdown -t3 -r now
pf::powerfail:/sbin/shutdown -f -h +2 "Power Failure; System Shutting Down"
pr:12345:powerokwait:/sbin/shutdown -c "Power Restored; Shutdown Cancelled"

1:2345:respawn:/sbin/mingetty tty1
2:2345:respawn:/sbin/mingetty tty2
3:2345:respawn:/sbin/mingetty tty3
4:2345:respawn:/sbin/mingetty tty4
5:2345:respawn:/sbin/mingetty tty5
6:2345:respawn:/sbin/mingetty tty6

x:5:respawn:/etc/X11/prefdm -nodaemon

$

Solaris 8 Container Build

1.      Identify the server OS that will be used inside zone (container). Create flar image and keep it in any NFS mount which can be accessible from Global.
#flarcreate -n mathiyam-flar-image -c -S -X /var/tmp/flar-exclude-list.out /lhotse2/mathiyam/mathiyam-flar-image.flar

An example of exclude file list would be (exclude /var/tmp, /tmp, /home, any NFS mount and all other non-root filesystem)
/tmp
/var/tmp
/form
/Application
………

2.      Install corresponding Solaris Legacy Container per OS version package from
paris: /export/install/SOL_10_0811_SPARC/solarislegacycontainers/1.0.1/Product in global. Note that this legacy package is required for branded zones only.

SUNWs9brandk à     Solaris 9 Containers: solaris9 brand support RTU
SUNWs8brandk à     Solaris 8 Containers: solaris8 brand support RTU

Login to Global and install the package.
#pkgadd –d . SUNWs8brandk

On successful brand legacy package installation, it will list on the system these packages

root@roja-global # pkginfo |grep SUNWs8brand
system      SUNWs8brandk         Solaris 8 Containers: solaris8 brand support RTU
system      SUNWs8brandr         Solaris 8 Containers: solaris8 brand support (Root)
system      SUNWs8brandu         Solaris 8 Containers: solaris8 brand support (Usr)
root@roja-global #

               Above Root and Usr packages are installed with Solaris 10 by default in global.

3.      Create a diskgroup “zonedg” using any unused free disk and create a filesystem of size at least twice the size of flar image. If more space is possible, add more to it for zone installation. Note that zone will see root (/) and /var out of this filesystem only.

/dev/vx/dsk/zonedg/f4tuna_s8vol
                     104857600 15672919 83612809    16%    /s8_f4tuna_zone_volume
/dev/vx/dsk/zonedg/lpdb9_s8vol
                     104857600 12616796 86478102    13%    /s8_lpdb9_zone_volume
root@pagubali-global

4.      Create a directory for zone path under the above filesystem by zone name which will be used in zone creation time.
Ex. #mkdir /s8_lpdb9_zone_volume/maari ; chmod 700 /s8_lpdb9_zone_volume/maari

5.      Create Zone now

root@pagubali-global # zonecfg -z maari
maari: No such zone configured
Use 'create' to begin configuring a new zone.
zonecfg:maari> create -b
zonecfg:maari> set zonepath=/s8_lpdb9_zone_volume/maari
zonecfg:maari> set brand=solaris8
zonecfg:maari> set autoboot=false
zonecfg:maari> set bootargs="-m verbose"
zonecfg:maari> set limitpriv=default,dtrace_user,graphics_access,graphics_map,net_rawaccess,proc_priocntl,proc_lock_memory,sys_ipc_config
zonecfg:maari> set scheduling-class=""                   ßWe are using Time Scheduler (TS)**
zonecfg:maari> set ip-type=shared                           ßNIC is shared between two containers
zonecfg:maari> add net
zonecfg:maari:net>
zonecfg:maari:net> set physical=nxge4                   ßThat’s the physical NIC will be used for sharing
zonecfg:maari:net> set address=10.41.138.41
zonecfg:maari:net> end
zonecfg:maari> add capped-memory
zonecfg:maari:capped-memory> set physical=44G              ßAllocating 44gb memory to Maari.
zonecfg:maari:capped-memory> end
zonecfg:maari> add rctl
zonecfg:maari:rctl> set name=zone.max-swap
zonecfg:maari:rctl> add value (priv=privileged,limit= 4294967296,action=deny)
zonecfg:maari:rctl> end
zonecfg:maari> add rctl
zonecfg:maari:rctl> set name=zone.max-locked-memory
zonecfg:maari:rctl> add value (priv=privileged,limit=4294967296,action=deny)
zonecfg:maari:rctl>end
zonecfg:maari> verify
zonecfg:maari> exit

Verify that Maari container is created and status shows configured.

root@pagubali-global # zoneadm list -cv
  ID NAME             STATUS     PATH                           BRAND    IP
   0 global           running    /                              native   shared
   4 pagubali          running    /s8_f4tuna_zone_volume/pagubali solaris8 shared
   - maari           configured /s8_lpdb9_zone_volume/maari solaris8 shared

6.      Install the Flar image now in the designated zone path location.

root@pagubali-global # zoneadm -z maari install -p -a /lhotse2/lpdb9/lpdb9-flar-image.flar
      Log File: /var/tmp/maari.install.853.log
        Source: /lhotse2/lpdb9/lpdb9-flar-image.flar
    Installing: This may take several minutes...
Postprocessing: This may take several minutes...

        Result: Installation completed successfully.
      Log File: /s8_lpdb9_zone_volume/maari/root/var/log/maari.install.853.log
root@pagubali-global #

After Flar image is installed, verify that status shows “installed”.

root@pagubali-global # zoneadm list -cv
  ID NAME             STATUS     PATH                           BRAND    IP
   0 global           running    /                              native   shared
   4 pagubali          running    /s8_f4tuna_zone_volume/pagubali solaris8 shared
   - maari           installed  /s8_lpdb9_zone_volume/maari solaris8 shared
root@pagubali-global #

7.      Creating pool set for CPU allocation to individual container. Here in this example, creating pset and pool for pagubali container.

Pooladm –s  ß create default poolcfg.conf file

root@pagubali-global # poolcfg -c 'create pset pset_pagubali (uint pset.min=32; uint pset.max=32)'
root@pagubali-global # poolcfg -c 'create pool pool_pagubali'
root@pagubali-global # poolcfg -c 'associate pool pool_pagubali (pset pset_pagubali)'
root@pagubali-global #pooladm -c           ß To commit

8.      Add the pool name in zone configuration as shows in this example for pagubali.

root@pagubali-global # zonecfg -z pagubali
zonecfg:pagubali> set pool=pool_pagubali
zonecfg:pagubali> verify
zonecfg:pagubali> commit
zonecfg:pagubali> exit

9.      Boot now zone
#zoneadm –z maari boot               ßFrom Global
#zoneadm list –cv                            ßVerify zone status shows “running”

#zlogin –z maari                ßlogin to container from Global
Question
The output of the "df" command in Linux may show long volume names that cause the remainder of the line to wrap to a second line.
How can I correctly process wrapped output in Monitor Solution for Linux?
[root]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                      4.8G  572M  4.0G  13% /
/dev/mapper/VolGroup00-LogVol04
                       13G  5.0G  6.9G  43% /var
/dev/mapper/VolGroup00-LogVol05
                      7.6G  4.0G  3.3G  55% /opt
/dev/mapper/VolGroup00-LogVol12
                      9.7G  2.7G  6.5G  29% /Recovery
/export/netinstall/RHEL5x-64/rhel-server-5.3-x86_64-dvd.iso
                      3.4G  3.4G     0 100% /RHEL5x_64
/export/netinstall/RHEL4x-64/RHEL4.6-x86_64-ES-DVD.iso
                      2.5G  2.5G     0 100% /RHEL4x_64
/export/netinstall/RHEL5.5x_64/rhel-server-5.5-x86_64-dvd.iso
                      3.5G  3.5G     0 100% /RHEL5.5x_64
[root]#

What Monitor Solution needs, is to have the "df" command return the results in this format:
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00                      4.8G  572M  4.0G  13% /
/dev/mapper/VolGroup00-LogVol04                       13G  5.0G  6.9G  43% /var
/dev/mapper/VolGroup00-LogVol05                      7.6G  4.0G  3.3G  55% /opt
/dev/mapper/VolGroup00-LogVol12                      9.7G  2.7G  6.5G  29% /Recovery
/export/netinstall/RHEL5x-64/rhel-server-5.3-x86_64-dvd.iso                      3.4G  3.4G     0 100% /RHEL5x_64
/export/netinstall/RHEL4x-64/RHEL4.6-x86_64-ES-DVD.iso                       2.5G  2.5G     0 100% /RHEL4x_64
/export/netinstall/RHEL5.5x_64/rhel-server-5.5-x86_64-dvd.iso                   3.5G  3.5G     0 100% /RHEL5.5x_64

Answer
We recommend using one of the following commands to get the unwrapped output from the "df" command:
df –hP
df –hP | column –t

[root]# df -hP
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00  4.8G  572M  4.0G  13% /
/dev/mapper/VolGroup00-LogVol04   13G  5.0G  6.9G  43% /var
/dev/mapper/VolGroup00-LogVol05  7.6G  4.0G  3.3G  55% /opt
/dev/mapper/VolGroup00-LogVol12  9.7G  2.7G  6.5G  29% /Recovery
/export/netinstall/RHEL5x-64/rhel-server-5.3-x86_64-dvd.iso  3.4G  3.4G     0 100% /RHEL5x_64
/export/netinstall/RHEL4x-64/RHEL4.6-x86_64-ES-DVD.iso  2.5G  2.5G     0 100% /RHEL4x_64
/export/netinstall/RHEL5.5x_64/rhel-server-5.5-x86_64-dvd.iso  3.5G  3.5G     0 100% /RHEL5.5x_64
[root]#

[root]# df -hP |column -t
Filesystem                                                                                            Size      Used     Avail    Use%  Mounted             on
/dev/mapper/VolGroup00-LogVol00                                                       4.8G     572M    4.0G     13%      /
/dev/mapper/VolGroup00-LogVol04                                                       13G      5.0G     6.9G     43%      /var
/dev/mapper/VolGroup00-LogVol05                                                       7.6G     4.0G     3.3G     55%      /opt
/export/netinstall/RHEL5x-64/rhel-server-5.3-x86_64-dvd.iso                     3.4G     3.4G     0          100%    /RHEL5x_64
/export/netinstall/RHEL4x-64/RHEL4.6-x86_64-ES-DVD.iso                     2.5G     2.5G     0          100%    /RHEL4x_64
/export/netinstall/RHEL5.5x_64/rhel-server-5.5-x86_64-dvd.iso                 3.5G     3.5G     0          100%    /RHEL5.5x_64

[root]#
Change sender ID on Solaris 10.

cat test.out | mailx -s "WeeklyReport" -r noreply@thamurali.com test123@thamurali.com

use -r option along with new sender id.

Vxrootadm on VxVM.

On Vxvm 6.0, Vxrootadm command has been Enhanced. So, we  can do the root mirror/split thru vxrootadm without manual task so far we followed in earlier versions.

Please find the below steps :


bash-3.2# vxdisk -oalldgs -e list
DEVICE       TYPE           DISK        GROUP        STATUS               OS_NATIVE_NAME   ATTR       
disk_0       auto:sliced    rootdgnew01  rootdgnew   online               c1t0d0s2         -           
disk_1       auto:sliced    -            -           online               c1t3d0s2         -           
disk_2       auto:sliced    -            -           online               c1t1d0s2         -           

     
bash-3.2#

bash-3.2# ./vxrootadm  addmirror  disk_2
[20:52:44]  VxVM vxrootadm INFO V-5-2-5571 Initialize disk disk_2 rootdgnew ...
[20:52:54]  VxVM vxrootadm INFO V-5-2-5569 Adding disk rootdgnew01-s0=disk_2 to group rootdgnew ...
[20:53:10]  VxVM vxrootadm INFO V-5-2-5575

        You have selected to add mirror volumes to disk group rootdgnew

        on new disk disk_2/rootdgnew01-s0, from volumes on disk_0/rootdgnew01.

        If you continue this operation, mirror volumes will be added on disk_2.

Do you wish to continue [y,n,q,?]  (default: n) y
[20:55:01]  VxVM vxrootadm INFO V-5-2-5570 Creating mirror rootdgnew rootdgnew01-s0 rootvol
[21:01:42]  VxVM vxrootadm INFO V-5-2-5570 Creating mirror rootdgnew rootdgnew01-s0 swapvol
[21:37:07]  VxVM vxrootadm INFO V-5-2-5570 Creating mirror rootdgnew rootdgnew01-s0 var
[21:49:14]  VxVM vxrootadm INFO V-5-2-4829 Bootsetup rootdgnew  ...
[21:49:51]  VxVM vxrootadm INFO V-5-2-4894 New boot disk created successfully.
[21:49:51]  VxVM vxrootadm INFO V-5-2-4893 Devalias for the new boot disk: vx-rootdgnew01-s0
bash-3.2# vxprint -g rootdgnew
TY NAME         ASSOC        KSTATE   LENGTH   PLOFFS   STATE    TUTIL0  PUTIL0
dg rootdgnew    rootdgnew    -        -        -        -        -       -

dm rootdgnew01  disk_0       -        286617216 -       -        -       -
dm rootdgnew01-s0 disk_2     -        286617216 -       -        -       -

v  rootvol      root         ENABLED  41945472 -        ACTIVE   -       -
pl rootvol-01   rootvol      ENABLED  41945472 -        ACTIVE   -       -
sd rootdgnew01-B0 rootvol-01 ENABLED  1        0        -        -       Block0
sd rootdgnew01-02 rootvol-01 ENABLED  41945471 1        -        -       -
pl rootvol-02   rootvol      ENABLED  41945472 -        ACTIVE   -       -
sd rootdgnew01-s0-01 rootvol-02 ENABLED 41945472 0      -        -       -

v  swapvol      swap         ENABLED  188744448 -       ACTIVE   -       -
pl swapvol-01   swapvol      ENABLED  188744448 -       ACTIVE   -       -
sd rootdgnew01-01 swapvol-01 ENABLED  188744448 0       -        -       -
pl swapvol-02   swapvol      ENABLED  188744448 -       ACTIVE   -       -
sd rootdgnew01-s0-02 swapvol-02 ENABLED 188744448 0     -        -       -

v  var          fsgen        ENABLED  52447104 -        ACTIVE   -       -
pl var-01       var          ENABLED  52447104 -        ACTIVE   -       -
sd rootdgnew01-03 var-01     ENABLED  52447104 0        -        -       -
pl var-02       var          ENABLED  52447104 -        ACTIVE   -       -
sd rootdgnew01-s0-03 var-02  ENABLED  52447104 0        -        -       -
bash-3.2#
bash-3.2#



bash-3.2# ./vxrootadm -vY split mirrordg rootdgnew01-s0
[21:52:17]  VxVM vxrootadm INFO V-5-2-5537 Move mirrors from rootdgnew to mirrordg
[21:52:21]  VxVM vxrootadm INFO V-5-2-5543 Remove rootdgnew01-s0 plexes: rootvol-02
swapvol-02
var-02 from rootdgnew
[21:52:24]# vxplex -f -g rootdgnew -o norestr dis rootvol-02 swapvol-02 var-02
[21:52:28]# vxedit -g rootdgnew -rfn rm rootvol-02 swapvol-02 var-02
[21:52:28]  VxVM vxrootadm INFO V-5-2-5542 Remove rootdgnew01-s0 from rootdgnew
[21:52:28]# vxdg -g rootdgnew rmdisk rootdgnew01-s0
.......
....... (outputs removed intentionally)
.........
[21:56:41]# umount /rda_altboot
[21:56:42]  VxVM vxrootadm INFO V-5-2-5550 Split boot disk successfully.
[21:56:42]  VxVM vxrootadm INFO V-5-2-5538 New Devalias for the boot disk: vx-rootdgnew01-s0
bash-3.2#
bash-3.2#

bash-3.2# vxdisk list
DEVICE       TYPE            DISK         GROUP        STATUS
disk_0       auto:sliced     rootdgnew01  rootdgnew    online
disk_1       auto:sliced     -            -            online
disk_2       auto:sliced     rootdgnew01-s0  mirrordg     online  ß root mirror disk in separate DG now.

bash-3.2# 

Now we can able to boot using "disk_2".

Title:  
Upgrade of SMCgcc in Solaris fails
Description
Date: 17/Feb/2014
OS Version: Solaris 10



Symptoms:
When upgrading on Solaris, you get the message:
"Current administration requires that a unique instance of the package be created. However, the maximum number of instances of the package which may be supported at one time on the same system has already been met. No changes were made to the system.



Resolution:  
In the file /var/sadm/install/admin/default
there is a line that affects pkgadd upgrade

If "instance=unique"
You cannot upgrade , you have to remove and then re-add a package

if "instance=overwrite"
You can upgrade , you don't have to remove and then re-add a package
(so just use vi, or similar, to edit the file and you will be able to upgrade SMCgcc)

Vethathiri Wallpaper


Vethathiri Maharishi - Wallpaper 1024 x 768

Putty screen freeze due to CTRL + S.


"Every time I accidentally press Ctrl + S in Putty when connected to any Solaris box via SSH, my session stops responding. How do I restore it?"

The reason:
Apparently CTRL+S actually does XOFF, which means the terminal will accept key strokes but won’t show the output of anything. It will appear as if your terminal is dead when it’s really just waiting to be turned back on. The fix? Simply press CTRL+Q to turn flow-control on (XON).

Important Note: All / Any keys you hit after hitting ctrl + s will be Buffered and Sent when you hit ctrl + q.
Warning: Don't send harmful commands. Because if you hit ENTER, it gets buffered too. All those commands WILL BE SENT and EXECUTED.

View the Control Characters in a file.


To find out the control characters in a file :

# cat -vet filename

-v       Non-printing  characters  (with  the  exception  of tabs,  new-lines  and form-feeds) are printed visibly. ASCII control characters (octal 000 - 037) are
              printed  as  ^n, where n is the corresponding ASCII character in the range octal 100 - 137 (@, A, B, C,. . ., X, Y, Z, [, \, ], ^, and _); the DEL character
(octal 0177) is printed ^?. Other non-printable characters are printed as M-x, where x is the ASCII character specified by the low-order seven bits.

-e       A $ character will be printed at the  end  of  each line (prior to the new-line).

-t       Tabs will be printed as ^I's and  formfeeds  to  be printed as ^L's.

return to previous directory


for Linux if u want to return to previous directory you can type.

$ cd -

this also works for Solaris, but if not working u can try this.
$ cd ~-

it's depends on your shell... 

awk ..


If you have a server with a lot of file systems on it. Then this little “awk” command can come in useful. It can obviously be used in many other situations also.

In this example, the disk group name is /homedg/.

bash-3.00$ grep homedg /etc/vfstab
/dev/vx/dsk/homedg/sanlogs      /dev/vx/rdsk/homedg/sanlogs     /var/log/sanlogs vxfs    1       yes     -
/dev/vx/dsk/homedg/common      /dev/vx/rdsk/homedg/common     /usr/local/common vxfs    2       yes     -
bash-3.00$

bash-3.00$ awk '/homedg/{print "mount -F "$4,$1,$3}' /etc/vfstab
mount -F vxfs /dev/vx/dsk/homedg/sanlogs /var/log/sanlogs
mount -F vxfs /dev/vx/dsk/homedg/common /usr/local/common
bash-3.00$

If you run it with piping it to 'sh', then it will execute the command. You can replace the 'mount' with whatever command you like.

Where is SAN_4.4.x software ( SAN Foundation Software) ?


To find Sun Storage SAN Foundation Software, log into http://support.oracle.com -> Select Patches  and Update -> Select Advance Search, type "10297699" Select and download.


 
Download Access
10297699 Sun StorEdge SAN 4.4.x (Patch) 4.4 Generic Platform (American English) General Sun Storage SAN Foundation Software  1+ year ago 39.7 MB Firmware, Software
Fetching Data...
1 Patch Selected  Read Me



# cd p10297699_440_Generic
# ls -l
total 81440
-rw-r--r--   1 nobody4  nogroup  22107233 Oct 19  2010 SAN_4.4.13_install_it.tar.Z
-rw-r--r--   1 nobody4  nogroup  11325492 Oct 19  2010 SAN_S9_4.4.14_install_it.tar.Z
-rw-r--r--   1 nobody4  nogroup  8149385 Oct 19  2010 SAN_S9_4.4.15_install_it.tar.bz2
-rw-r--r--   1 nobody4  nogroup     6034 Oct 19  2010 license_agreement1.html
-rw-r--r--   1 nobody4  nogroup      820 Oct 19  2010 read_me_install_it.txt
-rw-r--r--   1 nobody4  nogroup      150 Oct 19  2010 readme.html
#

Process Memory usage.

#!/bin/sh

psidno=19230
prstat -s rss 1 1 |grep $psidno > /tmp/jav.txt
mems=`prstat -s rss 1 1 | grep $psidno |awk '{print $4}' | sed '$s/.$//'`

if [ $mems -gt 1024 ]; then
mailx -s " Process Memory usage status :" thamurali@yahoo.co.in < /tmp/jav.txt
fi

-----------------------------------------------
Above script will send a mail  if  a particular PID using morethan 1gb of memory.
Note : untested.