Showing posts with label Solaris. Show all posts
Showing posts with label Solaris. Show all posts

Saturday, July 16, 2011

Solaris Command Reference

Solaris Command Reference
HD info(vendor, RPM, capacity)

oasis:/home/tse/dxy[9:18pm] iostat -E

sd0 Soft Errors: 0 Hard Errors: 3 Transport Errors: 0
Vendor: SEAGATE Product: ST34371W SUN4.2G Revision: 7462 Serial No: 9742K71685
RPM: 7200 Heads: 16 Size: 4.29GB <4292075520 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 3 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0

sd1 Soft Errors: 0 Hard Errors: 3 Transport Errors: 0
Vendor: SEAGATE Product: ST32171W SUN2.1G Revision: 7462 Serial No: 9736T74649
RPM: 5400 Heads: 19 Size: 2.13GB <2127708160 bytes>
Media Error: 0 Device Not Ready: 0 No Device: 3 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0

sd6 Soft Errors: 0 Hard Errors: 3 Transport Errors: 0
Vendor: TOSHIBA Product: XM5701TASUN12XCD Revision: 0997 Serial No: 04/09/97
RPM: 0 Heads: 0 Size: 18446744073.71GB <-8589934591 bytes>
Media Error: 0 Device Not Ready: 3 No Device: 0 Recoverable: 0
Illegal Request: 0 Predictive Failure Analysis: 0

Display the number of used and free i-nodes

impulse:/home/dxy[4:07pm] df -F ufs -o i
Filesystem iused ifree %iused Mounted on
/dev/dsk/c0t3d0s0 38555 403045 9% /
/dev/dsk/c0t1d0s0 160761 345607 32% /export/home
/dev/md/dsk/d20 149826 1905214 7% /usr/local
impulse:/home/dxy[4:07pm] /usr/ucb/df -i
Filesystem iused ifree %iused Mounted on
/dev/dsk/c0t3d0s0 38555 403045 9% /
/dev/dsk/c0t1d0s0 160761 345607 32% /export/home
/dev/md/dsk/d20 149826 1905214 7% /usr/local
impulse:/home/dxy[4:07pm]

Display processes with the highest CPU utilization

velocity:/home/dxy[4:54pm] ps -eo pid,pcpu,args | sort +1n

Display processes with the highest memory usage

velocity:/home/dxy[4:54pm] ps -eo pid,vsz,args | sort +1n

Printing disk geometry and partition info

oasis:/home/dxy[4:16pm] prtvtoc /dev/rdsk/c0t0d0s0
* /dev/rdsk/c0t0d0s0 partition map
*
* Dimensions:
* 512 bytes/sector
* 135 sectors/track
* 16 tracks/cylinder
* 2160 sectors/cylinder
* 3882 cylinders
* 3880 accessible cylinders
*
* Flags:
* 1: unmountable
* 10: read-only
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
0 2 00 0 7855920 7855919 /usr/local
1 3 01 7855920 524880 8380799
2 5 00 0 8380800 8380799
oasis:/home/dxy[4:16pm]

Checking whether it's running in 32-bit mode or 64-bit mode
64-bit mode

% isalist -v
sparcv9+vis sparcv9 sparcv8plus+vis sparcv8plus sparcv8 sparcv8-fsmuld sparcv7 sparc
% isainfo -v
64-bit sparcv9 applications
32-bit sparc applications

32-bit mode

% isalist -v
sparcv8plus+vis sparcv8plus sparcv8 sparcv8-fsmuld sparcv7 sparc
% isainfo -v
32-bit sparc applications

Verifying a route to a specified network

# route -n get xxx.yyy.zzz.0
route to: xxx.yyy.zzz.0
destination: default
mask: default
gateway: xxx.yyy.aaa.254
interface: hme0
flags:
recvpipe sendpipe ssthresh rtt,msec rttvar hopcount mtu expire
0 0 0 0 0 0 1500 0
#

print the version of OBP

% prtconf -V
OBP 3.3.2 1996/06/28 08:43

% /usr/platform/`uname -i`/sbin/prtdiag -v | grep OBP
OBP 3.11.1 1997/12/03 15:53 POST 3.11.4 1997/05/27 02:26
%

{2} ok .version
Release 3.23 Version 1 created 1999/07/16 12:08
OBP 3.23.1 1999/07/16 12:08
POST 2.0.2 1998/10/19 10:46
{2} ok

print the version of Open Windows

% showrev -w

OpenWindows version:
OpenWindows Version 3.6.1 25 January 1999

%

To determine which monitor resolution is available

% /usr/sbin/ffbconfig -res \?
Valid values for -res option are:
1024x768x60 [1]
1024x768x70 [1]
1024x768x75 [1] [2]
1024x768x77
1024x800x84
1152x900x66
1152x900x76
1280x800x76 [1] [2]
1280x1024x60 [1] [2]
1280x1024x67
1280x1024x76
1280x1024x85 [1] [2]
960x680x112s
960x680x108s
640x480x60 [1] [2]
640x480x60i [1]
768x575x50i [1]
1440x900x76 [1] [2]
1600x1000x66 [1] [2]
1600x1000x76 [1] [2]
1600x1280x76 [1] [2]
1920x1080x72 [1] [2]
1920x1080x76 [1] [2]
1920x1200x70 [1] [2]
1920x1200x75 [1] [2]
svga [1]
1152
1280
stereo
vga [1] [2]
ntsc [1]
pal [1]
none
Notes:
[1] monitor does not support this resolution.
[2] this version of FFB (FFB1) does not support this resolution.
%

system configuration
% sysdef
Display the device list (and drivers attached to devices)

% prtconf -D
System Configuration: Sun Microsystems sun4u
Memory size: 256 Megabytes
System Peripherals (Software Nodes):

SUNW,Ultra-1
packages
terminal-emulator
deblocker
obp-tftp
disk-label
ufs-file-system
chosen
openprom
client-services
options, instance #0 (driver name: options)
aliases
memory
virtual-memory
counter-timer
sbus, instance #0 (driver name: sbus)
SUNW,CS4231 (driver name: audiocs)
auxio
flashprom
SUNW,fdtwo, instance #0 (driver name: fd)
eeprom (driver name: eeprom)
zs, instance #0 (driver name: zs)
zs, instance #1 (driver name: zs)
sc
SUNW,pll
SUNW,fas, instance #0 (driver name: fas)
sd (driver name: sd)
st (driver name: st)
sd, instance #0 (driver name: sd)
sd, instance #1 (driver name: sd)
sd, instance #2 (driver name: sd)
sd, instance #3 (driver name: sd)
sd, instance #4 (driver name: sd)
sd, instance #5 (driver name: sd)
sd, instance #6 (driver name: sd)
sd, instance #7 (driver name: sd)
sd, instance #8 (driver name: sd)
sd, instance #9 (driver name: sd)
sd, instance #10 (driver name: sd)
sd, instance #11 (driver name: sd)
sd, instance #12 (driver name: sd)
sd, instance #13 (driver name: sd)
sd, instance #14 (driver name: sd)
SUNW,hme, instance #0 (driver name: hme)
SUNW,bpp (driver name: bpp)
SUNW,UltraSPARC
SUNW,ffb, instance #0 (driver name: ffb)
pseudo, instance #0 (driver name: pseudo)

processor type, speed

% psrinfo -v
Status of processor 0 as of: 06/16/99 12:38:51
Processor has been on-line since 02/07/99 01:47:11.
The sparcv9 processor operates at 200 MHz,
and has a sparcv9 floating point processor.

patch applied on the system
% showrev -p
exported file system on NFS server
% showmount -e NFS_SERVER
display current run level
% who -r
Find out a package which a file belongs to

% pkgchk -l -p /usr/lib/sendmail
Pathname: /usr/lib/sendmail
Type: regular file
Expected mode: 4555
Expected owner: root
Expected group: bin
Expected file size (bytes): 650720
Expected sum(1) of contents: 22626
Expected last modification: Apr 07 04:13:53 1999
Referenced by the following packages:
SUNWsndmu
Current status: installed

%

Examining gcc behavior
% gcc -v -x c /dev/null
Display the version of CDE

% /usr/ccs/bin/what /usr/dt/bin/dtmail
/usr/dt/bin/dtmail:
CDE Version 1.3.4
CDEVersion1.3.4

Display the version of BIND

% nslookup -class=chaos -q=txt version.bind ns0.optix.org
Server: impulse.optix.org
Address: 210.164.85.210
Aliases: 210.85.164.210.in-addr.arpa

VERSION.BIND text = "8.2.2-P5"
% dig @ns-tk021.ocn.ad.jp version.bind chaos txt
; <<>> DiG 8.2 <<>> @ns-tk021.ocn.ad.jp version.bind chaos txt
; (1 server found)
;; res options: init recurs defnam dnsrch
;; got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 6
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUERY SECTION:
;; version.bind, type = TXT, class = CHAOS

;; ANSWER SECTION:
VERSION.BIND. 0S CHAOS TXT "4.9.7-REL"

;; Total query time: 81 msec
;; FROM: velocity to SERVER: ns-tk021.ocn.ad.jp 203.139.160.103
;; WHEN: Tue May 9 17:26:23 2000
;; MSG SIZE sent: 30 rcvd: 64

%

system configuration

% /usr/platform/`uname -i`/sbin/prtdiag
System Configuration: Sun Microsystems sun4u 8-slot Sun Enterprise 4000/5000
System clock frequency: 82 MHz
Memory size: 512Mb

========================= CPUs =========================

Run Ecache CPU CPU
Brd CPU Module MHz MB Impl. Mask
--- --- ------- ----- ------ ------ ----
0 0 0 248 2.0 US-II 1.1
0 1 1 248 2.0 US-II 1.1
2 4 0 248 2.0 US-II 1.1
2 5 1 248 2.0 US-II 1.1


========================= Memory =========================

Intrlv. Intrlv.
Brd Bank MB Status Condition Speed Factor With
--- ----- ---- ------- ---------- ----- ------- -------
0 0 256 Active OK 60ns 2-way A
2 0 256 Active OK 60ns 2-way A

========================= IO Cards =========================

Bus Freq
Brd Type MHz Slot Name Model
--- ---- ---- ---- -------------------------------- ----------------------
1 SBus 25 3 SUNW,hme
1 SBus 25 3 SUNW,fas/sd (block)
1 SBus 25 13 SUNW,soc/SUNW,pln 501-2069
5 SBus 25 3 SUNW,hme
5 SBus 25 3 SUNW,fas/sd (block)
5 SBus 25 13 SUNW,soc/SUNW,pln 501-2069

Detached Boards
===============
Slot State Type Info
---- --------- ------ -----------------------------------------
3 disabled disk Disk 0: Target: 10 Disk 1: Target: 11
7 disabled disk Disk 0: Target: 14 Disk 1: Target: 15

No failures found in System
===========================

No System Faults found
======================

%

Source : http://www.optix.org/~dxy/solaris/command/

Some Gathering Solaris system information Stuff

Gathering Solaris system information
A UNIX administrator may be asked to gather system information about his/her Solaris systems. Here are the commands used on a Solaris 7 system to gather various system information.

Processors
The psrinfo utility displays processor information. When run in verbose mode, it lists the speed of each processor and when the processor was last placed on-line (generally the time the system was started unless it was manually taken off-line).

/usr/sbin/psrinfo -v
Status of processor 1 as of: 12/12/02 09:25:50
Processor has been on-line since 11/17/02 21:10:09.
The sparcv9 processor operates at 400 MHz,
and has a sparcv9 floating point processor.
Status of processor 3 as of: 12/12/02 09:25:50
Processor has been on-line since 11/17/02 21:10:11.
The sparcv9 processor operates at 400 MHz,
and has a sparcv9 floating point processor.

The psradm utility can enable or disable a specific processor.

To disable a processor:
/usr/sbin/psradm -f processor_id

To enable a processor:
/usr/sbin/psradm -n processor_id

The psrinfo utility will display the processor_id when run in either standard or verbose mode.

RAM
The prtconf utility will display the system configuration, including the amount of physical memory.

To display the amount of RAM:

/usr/sbin/prtconf | grep Memory
Memory size: 3072 Megabytes


Disk space
Although there are several ways you could gather this information, the following command lists the amount of kilobytes in use versus total kilobytes available in local file systems stored on physical disks. The command does not include disk space usage from the /proc virtual file system, the floppy disk, or swap space.

df -lk | egrep -v "Filesystem|/proc|/dev/fd|swap" | awk '{ total_kbytes += $2 } { used_kbytes += $3 } END { printf "%d of %d kilobytes in use.\n", used_kbytes, total_kbytes }'
19221758 of 135949755 kilobytes in use.

You may want to convert the output to megabytes or gigabytes and display the statistics as a percentage of utilization.

The above command will list file system usage. If you are interested in listing physical disks (some of which may not be allocated to a file system), use the format command as the root user, or the iostat -En command as a non-privileged user.


Processor and kernel bits
If you are running Solaris 2.6 or earlier, you are running a 32-bit kernel.

Determine bits of processor:
isainfo -bv

Determine bits of Solaris kernel:
isainfo -kv

Source : http://www.brandonhutchinson.com/

Saturday, April 30, 2011

Links

1- http://itsiti.com/

Friday, April 1, 2011

Links

http://www.netexpertise.eu
http://www.aixmind.com
http://aixblogs.blogspot.com
http://www.ahinc.com
http://users.cis.fiu.edu/~tho01/psg/aix.html

Thursday, March 31, 2011

Links

http://santosh-aix.blogspot.com/
https://www.ibm.com/developerworks/mydeveloperworks/blogs/cgaix/?page=1&maxresults=15&lang=en_us
http://unixskylab.wordpress.com/
http://windowspeople.com/
http://gibsonnet.net/aix/
http://wn.com/Ibm_Aix_Operating_System

Monday, March 28, 2011

Links

1- http://wiki-ux.info/
2- http://www.hpuxtips.es/
3- http://www.hpux.ch/index.php/Main_Page
4- http://aixibm.wordpress.com/

Links

1- http://asgaur.com/
2- http://cleophus59.blogspot.com

Links

1- http://aixwithdipakwarade.blogspot.com/
2- http://www.sys-admin.net/
3- http://unixarticles.com/
4- http://www.rootvg.net/
5- http://www.torontoaix.com/

Thursday, December 9, 2010

Make an ISO file of dvd

make sure media isn't mounted while running dd.

#dd if=/dev/rdsk/c0t0d0p0 of=/cdrom.iso

Wednesday, July 7, 2010

Mounting ISO image in solaris

1-assign device to file
#lofiadm -a /tmp/image.iso /dev/lofi/1

2-mount device to /mnt
$mount -F hsfs -o ro /dev/lofi/1 /mnt

Thursday, July 1, 2010

Solaris 10 IPMP Link Based Failure Detection in Virtualbox


Configuring Solaris 10 IPMP Link Based Failure Detection in Virtualbox for just testing purpose

Define 2 NIC in a Solarisx86 vm

1-view configuration

# ifconfig -a
lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
e1000g0: flags=201000843 mtu 1500 index 2
inet 192.168.1.14 netmask ffffff00 broadcast 192.168.1.255
groupname grp1
ether 8:0:27:3e:5b:87
e1000g1: flags=201000843 mtu 1500 index 3
inet 0.0.0.0 netmask ff000000 broadcast 0.255.255.255
groupname grp1
ether 8:0:27:41:a1:63



2- check files mapping to your nic's under /etc/


# more /etc/hostname*
::::::::::::::
/etc/hostname.e1000g0
::::::::::::::
solsrvr2 netmask + broadcast + group grp1 up
::::::::::::::
/etc/hostname.e1000g1
::::::::::::::
group grp1 up




3-check if mpathd is running or not

# ps -ef | grep mpathd
root 158 1 0 16:48:03 ? 0:01 /usr/lib/inet/in.mpathd -a



4- mpathd configuration under /etc/default/

# ls -l /etc/default/mpathd


5-testing you can disconnect network cable to simulate disconnecting cable

Wednesday, June 30, 2010

Viewing disks in solaris

bash-3.00# echo|format

multihomed host e.g muliple ips on same NIC

1-under
/etc/hosts

enter an entry as follows
192.168.10.10 myhost

2-under
/etc/netmasks

add an entry as follows
192.168.10.0 255.255.255.0

3-create a file point to your NIC for example
#touch /etc/hostname.e1000g0:1

add hostname for example
myhost

4-type the following command
#ifconfig e1000g0:1 plumb


5- assign ips
#ifconfig e1000g0:1 192.168.10.10 netmask 255.255.255.0 up

Add default route to sun solaris

You can add default route
by issuing the following command
#route add default 192.168.0.1

you can verify by viewing entries
$netstat -rn

Tuesday, June 22, 2010

Configure ipfilter on Solaris10 as a host based firewall

1- Start by check ipfilter status if it's running you can go ahead and configure rules
-bash-3.00$ svcs -a|grep -i ipfil
online 10:29:37 svc:/network/ipfilter:default


if it's disabled enable it
#svcadm enable ipfilter


2- Display rules
#bash-3.00ipfstat -io
block out all
pass out quick on lo0 all
pass out quick on eri0 proto tcp/udp from eri0/32 to any port = domain with keep state
pass out quick on eri0 proto tcp from eri0/32 to any port = http keep state
pass out quick on eri0 proto icmp from 192.168.1.0/24 to 192.168.1.0/24
block in all
pass in quick on lo0 all
pass in quick on eri0 proto icmp from 192.168.1.0/24 to 192.168.1.0/24
pass in quick on eri0 proto tcp from any to eri0/32 port = http keep state
pass in quick on eri0 proto tcp/udp from any to eri0/32 port = domain with keep state

3- Edit rules
under
/etc/ipf/ipf.conf


#vi /etc/ipf/ipf.conf



#
# ipf.conf
#
# IP Filter rules to be loaded during startup
#
# See ipf(4) manpage for more information on
# IP Filter rules syntax.
####
set intercept_loopback true;
block in all
block out all
### inbound traffic ###
pass in quick on lo0 all
pass in quick on eri0 proto icmp from 192.168.1.0/24 to 192.168.1.0/24
pass in quick on eri0 proto tcp from any to eri0/32 port = http keep state
pass in quick on eri0 proto tcp/udp from any to eri0/32 port = domain keep state

pass out quick on lo0 all
pass out quick on eri0 proto tcp/udp from eri0/32 to any port = 53 keep state
pass out quick on eri0 proto tcp from eri0/32 to any port = http keep state
pass out quick on eri0 proto icmp from 192.168.1.0/24 to 192.168.1.0/24

Monday, June 21, 2010

Print routing table using netstat

Print routing table using netstat

$netstat -rn

Add a route to sun Solaris

Add a route to sun Solaris
#route add -net 192.168.1.0 -netmask 255.255.255.0 192.168.1.1

Activate/Deactivate all interfaces ( NIC ) at once in solaris

Activate/Deactivate all interfaces ( NIC ) at once in solaris

Deactivating all at once

for i in `ifconfig -a|egrep -v '(inet|ether|lo0)'|cut -d: -f1`
do ifconfig $i down
done


Activating all at once

for i in `ifconfig -a|egrep -v '(inet|ether|lo0)'|cut -d: -f1`
do ifconfig $i up
done

Display stats and listening ports netstat

Display stats and listening ports netstat
You can Display stats and listening ports netstat for an iterface

$netstat -an -f inet -P tcp | egrep -i '(list|est|syn|time)'

Clear DNS cache

You can clear DNS cache in Solaris by doing the following

#/etc/init.d/nscd stop
#/etc/init.d/nscd start