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.

Check the HBA WWNs using luxadm command...

# luxadm -e port < -- check the link status.

Found path to 3 HBA ports

/devices/pci@8,600000/SUNW,qlc@4/fp@0,0:devctl CONNECTED

/devices/pci@8,700000/lpfc@2/fp@0,0:devctl CONNECTED

/devices/pci@8,700000/fibre-channel@3/fp@0,0:devctl CONNECTED

root: / >

# luxadm -e dump_map /devices/pci@8,700000/lpfc@2/fp@0,0:devctl <----------------- Use the HBA path here

Pos Port_ID Hard_Addr Port WWN Node WWN Type

0 140001 0 5005076300c3a73d 5005076300c0a73d 0x1f (Unknown Type)

1 14000b 0 5005076300cba73d 5005076300c0a73d 0x1f (Unknown Type)

2 14000c 0 5005076300cfa73d 5005076300c0a73d 0x1f (Unknown Type)

3 14000d 0 5005076300c7a73d 5005076300c0a73d 0x1f (Unknown Type)

4 a5e662 0 5005076300c79565 5005076300c09565 0x0 (Disk device)

5 a5e663 0 5005076300c39565 5005076300c09565 0x0 (Disk device)

6 20024 0 10000000c9430869 20000000c9430869 0x1f (Unknown Type,Host Bus Adapter) < --------------------- WWN in Green

root : >

#

Check the process with the help of port....

#!/bin/ksh

line='---------------------------------------------'
pids=$(/usr/bin/ps -ef | sed 1d | awk '{print $2}')

if [ $# -eq 0 ]; then
read ans?"Enter port you would like to know pid for: "
else
ans=$1
fi

for f in $pids
do
/usr/proc/bin/pfiles $f 2>/dev/null | /usr/xpg4/bin/grep -q "port: $ans"
if [ $? -eq 0 ]; then
echo $line
echo "Port: $ans is being used by PID:\c"
/usr/bin/ps -ef -o pid -o args | egrep -v "grep|pfiles" | grep $f
fi
done
exit 0


--------------------------------------------------------------

# ./portcheck.sh
Enter port you would like to know pid for:22
---------------------------------------------
Port: 22 is being used by PID: 5936 ssh ncens180
---------------------------------------------
Port: 22 is being used by PID: 462 /usr/local/sbin/sshd
---------------------------------------------
Port: 22 is being used by PID:27325 ssh usnencs006
---------------------------------------------
Port: 22 is being used by PID: 5397 /usr/local/sbin/sshd
---------------------------------------------
Port: 22 is being used by PID: 7026 ssh usnencs009
---------------------------------------------
Port: 22 is being used by PID: 898 /usr/local/sbin/sshd
---------------------------------------------
Port: 22 is being used by PID:14100 /usr/local/sbin/sshd
---------------------------------------------
Port: 22 is being used by PID: 8931 ssh ncens185
---------------------------------------------
Port: 22 is being used by PID:26979 /usr/local/sbin/sshd
---------------------------------------------
Port: 22 is being used by PID: 8025 ssh ncens185
---------------------------------------------
Port: 22 is being used by PID: 3915 /usr/local/sbin/sshd
---------------------------------------------
Port: 22 is being used by PID: 5699 /usr/local/sbin/sshd
---------------------------------------------
Port: 22 is being used by PID: 8467 ssh usnencs201
---------------------------------------------
Port: 22 is being used by PID: 6658 ssh ncens185
---------------------------------------------
Port: 22 is being used by PID:13167 /usr/local/sbin/sshd
---------------------------------------------
Port: 22 is being used by PID: 6656 /usr/local/sbin/sshd
---------------------------------------------
Port: 22 is being used by PID: 7718 /usr/local/sbin/sshd
root: />

Upgrading OBP ...



1) Determine the System's Current Firmware Revisions
-------------------------------------------------

While the OS is running the following command may be used to
determine the current system firmware revisions;

/usr/sbin/prtconf -V
or
/usr/platform/sun4u/sbin/prtdiag -v | grep OBP

The firmware revisions may also be determined from the PROM monitor's
"ok" prompt with the following command;

.version

2) Compare the current Flash PROM firmware revision with the available or
latest Flash PROM firmware revisions.

Compare the output of the OBP line in the "prtdiag -v" or "prtconf -V"
output. Find the revision number and compare with the revision on the
entries below that of the "flash-update-Blade1000-latest" line

Available Firmware Revisions
----------------------------
flash-update-Blade1000-latest:
OBP 4.16.4 2004/12/18 05:18 Sun Fire 280R
Sun Fire[TM] V280, Sun Blade[TM] 1000 POST 4.16.3 2004/11/05 20:02
OBDIAG 4.16.4 2004/12/18 05:21

flash-update-Blade1000-old:
OBP 4.13.0 2004/01/19 18:27 Sun Fire 280R
Sun Fire[TM] V280, Sun Blade[TM] 1000 POST 4.13.0 2004/03/15 19:13
OBDIAG 4.13.0 2004/01/19 18:30

3) Is the UPGRADE NECESSARY?

If the current Flash PROM revision matches the version numbers given under
the flash-update-Blade1000-latest line, then STOP Here. This UPGRADE IS NOT
NECESSARY.
If the current Flash PROM firmware revision is lower than the latest
firmware revision in this patch, then proceed to the next step.

4) Preparing the System
---------------------

a) As root, copy the latest "flash-update" files from the directory
containing the patch (for example : 118323-01)to the root directory as follows:

# cp flash*latest /
# chmod 755 /flash-update*

In order to boot the binary, it must be located within the root
partition. If it is not already located within the root partition
then move it to /. If the binary is already located elsewhere
within the root partition then note the exact filepath so that the
binary can be booted later.

b) As root, exit the OS such that the system returns to the PROM's "ok"
prompt:

# halt
ok

5) Running the Flash Update Utility
--------------------------------

a) The system should now display the PROM monitor's "ok" prompt.
Now boot the Flash update utility as given below:

CAUTION: Do not boot/run revisions lower than the latest unless you
are absolutely sure that that is what you want to do!

ok boot disk /flash-update-Blade1000-latest

NOTE: If your system's boot device is not "disk" then you will
have to specify the appropriate devalias (e.g. disk2).
If the binary is located in a location other than / then
provide the entire filepath after the boot device.

Answer the questions as prompted by the utility.


+++++++++++++++++++++ example Flash update follows ++++++++++++++++++++++++
--More--(49%)
++++++++ Note that this is an example only. Much of the information ++++++
++++++++ which is displayed by your system will be different from ++++++
++++++++ what is shown below. ++++++
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Standalone Flash PROM Update Utility, Rev. 2.7
Ultra[tm] 1
Ultra[tm] 2
Ultra[tm] 5/10
Ultra[tm] 30
Ultra[tm] 60 / E220R
Ultra[tm] 80 / E420R
Ultra[tm] Enterprise(tm) 250
Ultra[tm] Enterprise(tm) 450
Sun Blade[tm] 100
Sun Blade[tm] 1000
Sun Fire [tm] 280R
Netra[tm] T20

This utility allows you to interactively update the firmware
revisions in specific system Flash PROM components.
Type h for help, q to quit, Return or Enter to continue:

Every precaution should be taken to prevent the loss of system
power during the Flash PROM programming process!

Type h for help, q to quit, Return or Enter to continue:


Firmware Release(s) Firmware Release(s)
Currently Existing in the System Available for Installation / Install?
---------------------------------- -------------------------------------------
OBP 3.1.2 1996/03/28 17:08 OBP 4.6.7 2002/07/24 15:43 no
POST 3.1.4 1996/04/09 03:23 POST 4.6.2 2002/06/20 12:50 no

Type sa if you wish to select all available firmware releases for
installation. Type h for help, quit to exit, or cont to continue: sa



Firmware Release(s) Firmware Release(s)
Currently Existing in the System Available for Installation / Install?
---------------------------------- -------------------------------------------
OBP 3.1.2 1996/03/28 17:08 OBP 4.6.7 2002/07/24 15:43 YES
POST 3.1.4 1996/04/09 03:23 POST 4.6.2 2002/06/20 12:50 YES

Type sa if you wish to select all available firmware releases for
installation. Type h for help, quit to exit, or cont to continue: cont


The Flash programming process is about to begin.

Type h for help, q to quit, Return or Enter to continue:

Erasing the top half of the Flash PROM.
Programming OBP into the top half of the Flash PROM.
Verifying OBP in the top half of the Flash PROM.

Erasing the bottom half of the Flash PROM.
Programming OBP into the bottom half of Flash PROM.
Verifying OBP in the bottom half of the Flash PROM.

Erasing the top half of the Flash PROM.
Programming POST into the top half of Flash PROM.
Verifying POST in the top half of the Flash PROM.

Programming was successful.

+++++++++++++++++++++ example Flash update ends ++++++++++++++++++++++++++

Once the PROM's banner reappears then use the Stop-A keys (or Break
key, if running from a serial line) to abort the auto-boot sequence
if the system begins to boot.

6) Verifying successful Flash PROM Update

Verify from the results of the .version command that the OBP
version matches the OBP version given above under the
flash-update-Blade1000-latest entry in Step 2.

7) Resume operations

a) Allow the system to auto-boot, or issue the boot command for your
environment as necessary.

b) Once the system has rebooted you may wish to remove the Flash Update
binaries and documents since they will no longer be needed.
# rm /flash-update*

c) Remember to remove the files from their original location if
they were not extracted directly into the root directory.




Steps to grow the filesystem additional 30Gb in SVM softpartition.(without data loss)

Steps to grow the filesystem additional 30Gb in SVM softpartition.

1. Adding 30Gb new disk into d370 metadevice.
2. Attach 30Gb(grow size) to d31 softpartition.
3. Grow the d371 softpartition.
4. Check the result.


root:/ > metastat d371
d371: Soft Partition
Device: d370
State: Okay
Size: 71303168 blocks (34 GB)
Extent Start Block Block count
0 1952 71303168

d370: Concat/Stripe
Size: 72888960 blocks (34 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
/dev/dsk/emcpower32a 0 No Okay No
Stripe 1:
Device Start Block Dbase State Reloc Hot Spare
/dev/dsk/emcpower33g 1920 No Okay No
Stripe 2:
Device Start Block Dbase State Reloc Hot Spare
/dev/dsk/emcpower34a 1920 No Okay No

Device Relocation Information:
Device Reloc Device ID
/dev/dsk/emcpower32a No -
/dev/dsk/emcpower33g No -
/dev/dsk/emcpower34a No -


root:/ > metastat d370
d370: Concat/Stripe
Size: 72888960 blocks (34 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
/dev/dsk/emcpower32a 0 No Okay No
Stripe 1:
Device Start Block Dbase State Reloc Hot Spare
/dev/dsk/emcpower33g 1920 No Okay No
Stripe 2:
Device Start Block Dbase State Reloc Hot Spare
/dev/dsk/emcpower34a 1920 No Okay No

Device Relocation Information:
Device Reloc Device ID
/dev/dsk/emcpower32a No -
/dev/dsk/emcpower33g No -
/dev/dsk/emcpower34a No -



root:/ > metattach d370 c2t5006016041E0F15Bd2s2
d370: component is attached

root:/ > metastat d370
d370: Concat/Stripe
Size: 135799680 blocks (64 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
/dev/dsk/emcpower32a 0 No Okay No
Stripe 1:
Device Start Block Dbase State Reloc Hot Spare
/dev/dsk/emcpower33g 1920 No Okay No
Stripe 2:
Device Start Block Dbase State Reloc Hot Spare
/dev/dsk/emcpower34a 1920 No Okay No
Stripe 3:
Device Start Block Dbase State Reloc Hot Spare
/dev/dsk/c2t5006016041E0F15Bd2s2 1280 No Okay Yes

Device Relocation Information:
Device Reloc Device ID
/dev/dsk/emcpower32a No -
/dev/dsk/emcpower33g No -
/dev/dsk/emcpower34a No -
/dev/dsk/c2t5006016041E0F15Bd2 Yes id1,ssd@n60060160f8122300a2c36a1c88dae011


root:/ > df -h /stag
Filesystem size used avail capacity Mounted on
/dev/md/dsk/d371 33G 17G 16G 51% /stag

root:/ > metattach d371 30g
d371: Soft Partition has been grown
root:/ > metastat d371
d371: Soft Partition
Device: d370
State: Okay
Size: 134217728 blocks (64 GB)
Extent Start Block Block count
0 1952 134217728

d370: Concat/Stripe
Size: 135799680 blocks (64 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
/dev/dsk/emcpower32a 0 No Okay No
Stripe 1:
Device Start Block Dbase State Reloc Hot Spare
/dev/dsk/emcpower33g 1920 No Okay No
Stripe 2:
Device Start Block Dbase State Reloc Hot Spare
/dev/dsk/emcpower34a 1920 No Okay No
Stripe 3:
Device Start Block Dbase State Reloc Hot Spare
/dev/dsk/c2t5006016041E0F15Bd2s2 1280 No Okay Yes

Device Relocation Information:
Device Reloc Device ID
/dev/dsk/emcpower32a No -
/dev/dsk/emcpower33g No -
/dev/dsk/emcpower34a No -
/dev/dsk/c2t5006016041E0F15Bd2 Yes id1,ssd@n60060160f8122300a2c36a1c88dae011
root:/ >


root:/ > growfs -M /stag /dev/md/rdsk/d371
/dev/md/rdsk/d371: Unable to find Media type. Proceeding with system determined parameters.
Warning: 4096 sector(s) in last cylinder unallocated
/dev/md/rdsk/d371: 134217728 sectors in 21846 cylinders of 48 tracks, 128 sectors
65536.0MB in 1366 cyl groups (16 c/g, 48.00MB/g, 5824 i/g)
super-block backups (for fsck -F ufs -o b=#) at:
32, 98464, 196896, 295328, 393760, 492192, 590624, 689056, 787488, 885920,
Initializing cylinder groups:
...........................
super-block backups for last 10 cylinder groups at:
133301792, 133400224, 133498656, 133597088, 133695520, 133793952, 133892384,
133990816, 134089248, 134187680

root:/ > df -k /stag
Filesystem kbytes used avail capacity Mounted on
/dev/md/dsk/d371 66092522 17594518 48146890 27% /stag


root:/ > df -h /stag
Filesystem size used avail capacity Mounted on
/dev/md/dsk/d371 63G 17G 46G 27% /stag
root:/ >