Search This Blog

Monday 23 November 2009

Some Solaris commands for getting configurations

Network speed
root@test# dladm show-dev
bge0 link: up speed: 1000 Mbps duplex: full
bge1 link: up speed: 1000 Mbps duplex: full
bge2 link: up speed: 100 Mbps duplex: full
bge3 link: down speed: 0 Mbps duplex: unknown
nxge0 link: up speed: 1000 Mbps duplex: full
nxge1 link: unknown speed: 0 Mbps duplex: unknown
nxge2 link: unknown speed: 0 Mbps duplex: unknown
nxge3 link: down speed: 0 Mbps duplex: unknown
WWN number of HBA
root@server # fcinfo hba-port
HBA Port WWN: 10000000c952c6e2
OS Device Name: /dev/cfg/c2
Manufacturer: Sun Microsystems, Inc.
Model: LP10000DC-S
Type: unknown
State: offline
Supported Speeds: 1Gb 2Gb
Current Speed: not established
Node WWN: 20000000c952c6e2
HBA Port WWN: 10000000c952c6e1
OS Device Name: /dev/cfg/c3
Manufacturer: Sun Microsystems, Inc.
Model: LP10000DC-S
Type: unknown
State: offline
Supported Speeds: 1Gb 2Gb
Current Speed: not established
Node WWN: 20000000c952c6e1
root: /export/home/appl > prtconf -vp | grep wwn
port-wwn: 210000e0.8b8613ae
node-wwn: 200000e0.8b8613ae
port-wwn: 210000e0.8b8f4d67
node-wwn: 200000e0.8b8f4d67
root: /export/home/appl > prtpicl -v -c scsi-fcp | grep wwn
:node-wwn 20 00 00 e0 8b 86 13 ae
:port-wwn 21 00 00 e0 8b 86 13 ae
:node-wwn 20 00 00 e0 8b 8f 4d 67
:port-wwn 21 00 00 e0 8b 8f 4d 67
Complete Serial number saved in the machine
root@host1 # /opt/SUNWsneep/bin/sneep -a
ChassisSerialNumber from eeprom :
0516MM2x88
ChassisSerialNumber from backup : /etc/default/SUNWsneep :
0516MM2x88
ChassisSerialNumber from explorer :
0516MM2x88
ChassisSerialNumber from cst :
0516MM2x88
Maximum allowed process

root@latheefp# ulimit -a

core file size (blocks, -c) unlimited

data seg size (kbytes, -d) unlimited

file size (blocks, -f) unlimited

open files (-n) 256

pipe size (512 bytes, -p) 10

stack size (kbytes, -s) 8192

cpu time (seconds, -t) unlimited

max user processes (-u) 395

virtual memory (kbytes, -v) unlimited

root@latheefp# cat /etc/system|grep max

* set maxusers=40

shmsys:shminfo_shmmax 4294967295

set shmsys:shminfo_shmmax=4294967295

set max_nprocs=400

set rlim_fd_max=1024

root@latheefp# sysdef -i|grep max

drv/sparcv9/max1617

683368448 maximum memory allowed in buffer cache (bufhwm)

400 maximum number of processes (v.v_proc)

99 maximum global priority in sys class (MAXCLSYSPRI)

395 maximum processes per user id (v.v_maxup)

9 maximum number of pushes allowed (NSTRPUSH)

65536 maximum stream message size (STRMSGSZ)

1024 max size of ctl part of message (STRCTLSZ)

60 maximum time sharing user priority (TSMAXUPRI)

How to get LUN ID, WWN of a LUN
bash-3.00# luxadm probe
No Network Array enclosures found in /dev/es
Found Fibre Channel device(s):
Node WWN:5005076304ffc7c2 Device Type:Disk device
Logical Path:/dev/rdsk/c3t6005076304FFC7C2000000000000115Ad0s2
Node WWN:5005076304ffc7c2 Device Type:Disk device
Logical Path:/dev/rdsk/c3t6005076304FFC7C2000000000000107Ad0s2
Node WWN:5005076304ffc7c2 Device Type:Disk device
Logical Path:/dev/rdsk/c3t6005076304FFC7C2000000000000107Bd0s2
Node WWN:5005076304ffc7c2 Device Type:Disk device
Logical Path:/dev/rdsk/c3t6005076304FFC7C2000000000000107Cd0s2
Node WWN:5005076304ffc7c2 Device Type:Disk device
Logical Path:/dev/rdsk/c3t6005076304FFC7C20000000000001064d0s2
Node WWN:5005076304ffc7c2 Device Type:Disk device
Logical Path:/dev/rdsk/c3t6005076304FFC7C20000000000001065d0s2
Node WWN:5005076304ffc7c2 Device Type:Disk device
Logical Path:/dev/rdsk/c3t6005076304FFC7C20000000000001015d0s2
Node WWN:5005076304ffc7c2 Device Type:Disk device
Logical Path:/dev/rdsk/c3t6005076304FFC7C20000000000001014d0s2
bash-3.00# luxadm display /dev/rdsk/c3t6005076304FFC7C2000000000000107Bd0s2
DEVICE PROPERTIES for disk: /dev/rdsk/c3t6005076304FFC7C2000000000000107Bd0s2
Vendor: IBM
Product ID: 2107900
Revision: .690
Serial Num: 75CVGC1107B
Unformatted capacity: 102400.000 MBytes
Write Cache: Enabled
Read Cache: Enabled
Minimum prefetch: 0x0
Maximum prefetch: 0x16
Device Type: Disk device
Path(s):
/dev/rdsk/c3t6005076304FFC7C2000000000000107Bd0s2
/devices/scsi_vhci/ssd@g6005076304ffc7c2000000000000107b:c,raw
Controller /devices/pci@1,700000/SUNW,qlc@0/fp@0,0
Device Address 50050763041807c2,5
Host controller port WWN 2100001b3209feeb
Class primary
State ONLINE
Controller /devices/pci@0,600000/pci@0/pci@9/SUNW,qlc@0/fp@0,0
Device Address 50050763041307c2,5
Host controller port WWN 2100001b320a239f
Class primary
State ONLINE
MPXIO Verion in Solaris
root@latheef # modinfo | egrep '(SunFC|mpxio|scsi_vhci)'
82 138feea 16680 149 1 fp (SunFC Port v20061220-1.66)
84 13aa6e5 8314 - 1 fctl (SunFC Transport v20061220-1.38)
86 13b1021 c7604 153 1 qlc (SunFC Qlogic FCA v20061215-2.18)
140 7879c000 2084b 150 1 fcp (SunFC FCP v20061220-1.94)
141 787be000 5794 - 1 mpxio (MDI Library v20070104-1.20)
142 787c4000 deca 189 1 scsi_vhci (SCSI vHCI Driver v20070104-1.45)
HBA Firmware information
root@lathef # luxadm qlgc
Found Path to 4 FC100/P, ISP2200, ISP23xx Devices
Opening Device: /devices/pci@15d,600000/SUNW,qlc@1/fp@0,0:devctl
Detected FCode Version: QLA2462 Host Adapter Driver(SPARC): 1.11 10/03/05
Opening Device: /devices/pci@15d,600000/SUNW,qlc@1,1/fp@0,0:devctl
Detected FCode Version: QLA2462 Host Adapter Driver(SPARC): 1.11 10/03/05
Opening Device: /devices/pci@17d,600000/SUNW,qlc@1/fp@0,0:devctl
Detected FCode Version: QLA2462 Host Adapter Driver(SPARC): 1.11 10/03/05
Opening Device: /devices/pci@17d,600000/SUNW,qlc@1,1/fp@0,0:devctl
Detected FCode Version: QLA2462 Host Adapter Driver(SPARC): 1.11 10/03/05
Complete
Will Conti......

Sunday 22 November 2009

Configuring solaris system as syslog server

By this proceedure, you can monitor all system logs froma a single host.

For configuring syslog server in Unix, nothing to do in sever side. Do the following changes in client side

1. Make a backup of /etc/syslog.conf file

2. Add the hostname of server in /etc/host (server should be pingable using hostname either DNS)

3. Add this line /etc/syslog.conf of client

4.

*.err;kern.debug;daemon.notice;mail.crit @remoteunixhostname

Note down, don’t use any space in /etc/syslog.conf file, use only tabs instead.

5. Restart sylog service in client

svcadm restart svc:/system/system-log:default -> this is for solari 10

/etc/init.d/syslog stop; /etc/init.d/syslog start -> this is for other solaris OS

6. Make sure UDP port 514 is opened from client to server (client -514 ->server)

Once its ok, you will be all to see all logs generated in clients will be logged either in /var/adm/messages of server and /var/adm/messages of client. If you have multiple client add the same entry in all client. Messages can be identified from server side, by host name of the client in each line of messages.

My non interactive jumpstart server sample configuration-using iso image

#creating a loopback device using iso image
root@cat # lofiadm -a /admin/unix/jump/ISO/sol-10-u5-ga-sparc-dvd.iso /dev/lofi/1
#mouting lofidevice to /mnt
root@cat # mount -F hsfs /dev/lofi/1 /mnt
#command for copying DVD content inclulding boot block to the machine (normal jumpstart command)
root@cat # /mnt/Solaris_10/Tools/setup_install_server /admin/unix/jump/10u5/
root@cat # cat sysidcfg
system_locale=en_US
timezone=Asia/Riyadh
network_interface=primary {protocol_ipv6=no netmask=255.255.254.0 default_route=none}
terminal=vt100
security_policy=NONE
name_service=NONE
timeserver=localhost
root_password=e1VrOBR04fXBY
nfs4_domain=dynamic
keyboard=US-English
root@cat # cat rules
#This is the role set for each machine. Eg is given in first second line
hostname cat - solaris10.flar -
hostname gorilla-mgt - gorilla.os gorilla.finish
hostname bear-mgt - v245.flar bear.finish
hostname tiger-mgt - v245.flar tiger.finish
root@cat # cat gorilla.os
install_type initial_install
system_type standalone
partitioning explicit
filesys rootdisk.s0 40460 /
filesys rootdisk.s1 16384 swap
filesys rootdisk.s3 76001 /var
filesys rootdisk.s4 2007 /opt/patrol
filesys rootdisk.s5 2007 /opt/tivoli
filesys rootdisk.s7 100 unnamed
cluster SUNWCprog
package SUNWman delete
cluster SUNWCacc
root@cat # cat v245.flar
install_type flash_install
archive_location nfs 10.14.48.26:/admin/unix/jump/flars/V245.flar
partitioning explicit
filesys rootdisk.s0 40460 /
filesys rootdisk.s1 16384 swap
filesys rootdisk.s3 76001 /var
filesys rootdisk.s4 2007 /opt/patrol
filesys rootdisk.s5 2007 /opt/tivoli
filesys rootdisk.s7 100 unnamed
root@cat # cat gorilla.finish
echo "Starign post scripts"
echo "10.14.11.172 gorilla-bge1 gorilla-bge1.prod.mobily.lan">>/a/etc/hosts
echo "10.14.11.173 gorilla-nxge0 gorilla-nxge0.prod.mobily.lan">>/a/etc/hosts
echo "10.14.11.174 gorilla gorilla.prod.mobily.lan">>/a/etc/hosts
#Lines for adding ipmp configuration automatically
echo "gorilla-bge1 deprecated -failover netmask + broadcast + group development up" > /a/etc/hostname.bge1
echo "addif gorilla netmask + broadcast + up" >> /a/etc/hostname.bge1
echo "gorilla-nxge0 deprecated -failover netmask + broadcast + group development up">/a/etc/hostname.nxge0
echo "10.14.11.0 255.255.255.0" >>/a/etc/netmasks
echo "10.14.11.1" >/a/etc/defaultrouter
rm -r /a/.ssh
mkdir /a/.ssh
echo "ssh-dss AAAAB3NzaC1kc3MAAACBAOGV11ge/Qa+z+4Ydvd/s+6aGdweqEqTrvWgPtW0Axl3RrJ2LZmt8toWDumEVfxKnX4yb7YIvSR/cFrKAmE1UI6PN2dmVdybIDOmC+dfDQ4UmdlDMueNdkTY06NTRPrMELFAiKwNNRspW4q7DT43yreCWx/8zYSuOqr+OxET2wChAAAAFQDM5Bm9IpVI/QBZTMvKlBxeoBjk6QAAAIEAggMnQeJylappw8II3WB+LFWvlyUTnNMNIuzrGyrMxXsb8CZ8fZKXpK+h+WKWXyiqqnJ2svqtUgXbKlOrmCVoSDqU15xOv32emDk6BPiwBLcedoOJ3TRLnZu/Ogafy8pltrfJKi9Ffjblfdi1muDjmcw5JU9CPh1Zh08G5uogpX4AAACAFOBYOQn6UYMrZY/KYw3f4hFk6/qdGEu7YQNhMZvSft0/L5bVV/QlWF7DLzwiGnooUmTAXav9G2V5tqVctoHKejyoMQeAXzgZGMAmmiDhcGG6Cl813SOjZwfKZCVYve/yelr9IY2UVi/psQr6gzWdcRB69LHvZRpYfKO6H9z6+3s= root@cat">/a/.ssh/authorized_keys
#command for adding one clinent
../10u5/Solaris_10/Tools/add_install_client -e 0:14:4f:d2:e8:d0 -s 10.14.48.26:/admin/unix/jump/10u5/ -c 10.14.48.26:/admin/unix/jump/config -p 10.14.48.26:/admin/unix/jump/config gorilla sun4u
root@cat # cat /etc/ethers |grep gorilla
0:14:4f:d2:e8:d0 gorilla-mgt
root@cat # cat /etc/hosts|grep gorilla
10.14.48.27 gorilla-sc
10.14.48.28 gorilla-mgt

Script for Continuous monitoring of percentage of page file usage in solaris

#script for monitoring page file usage in %. written by latheefp@gmail.com
while true
do
used=`swap -s|awk {'print $9'}|cut -dk -f1`
#echo "Used is :`expr $used / 1024`MB"
avail=`swap -s|awk {'print $11'}|cut -dk -f1`
#echo "Available is :`expr $avail / 1024`MB"
total=`expr $used + $avail`
#echo "Total is :`expr $total / 1024`MB"
percused=`expr $used \* 100`
percent=`expr $percused / $total`
#echo "Percentage of page file usage is :$percent% "
clear
echo "Used Available Total %Used"
echo "`expr $used / 1024`MB `expr $avail / 1024`MB `expr $total / 1024`MB $percent%"
sleep 5
done