Acerca de Linux, BSD y notas personales

Archives for solaris category

### ps ###


1. ps, ps -ef (includes all processes)
2. pgrep - searches process list for matching programms
3. pkill - searches process list for matching programs and kills them

4. pwdx 1064 what directory is running a process
5. prstat ( like top in linux )
6. prtdiag - display system diagnostic information

Currently running:

1. ps


[ssybl0:~]$ ps
PID TTY TIME CMD
1030 pts/2 0:00 bash
1034 pts/2 0:00 ps

All the programs
2. ps -ef


[ssybl0:~]$ ps -ef
UID PID PPID C STIME TTY TIME CMD
root 0 0 0 19:19:06 ? 0:20 sched
root 1 0 0 19:19:08 ? 0:00 /sbin/init
root 2 0 0 19:19:08 ? 0:00 pageout
root 3 0 0 19:19:08 ? 1:06 fsflush
daemon 310 1 0 19:19:32 ? 0:00 /usr/sbin/rpcbind
root 7 1 0 19:19:09 ? 0:08 /lib/svc/bin/svc.startd
root 9 1 0 19:19:09 ? 0:29 /lib/svc/bin/svc.configd
root 335 1 0 19:19:34 ? 0:02 /usr/lib/inet/inetd start
daemon 315 1 0 19:19:32 ? 0:00 /usr/lib/nfs/statd
carlosap 968 965 0 20:07:00 ? 0:00 /usr/lib/ssh/sshd
root 366 364 0 19:19:34 ? 0:00 /usr/sadm/lib/smc/bin/smcboot
root 118 1 0 19:19:23 ? 0:00 /usr/lib/ldoms/drd
smmsp 542 1 0 19:19:41 ? 0:00 /usr/lib/sendmail -Ac -q15m
root 364 1 0 19:19:34 ? 0:00 /usr/sadm/lib/smc/bin/smcboot
daemon 316 1 0 19:19:32 ? 0:00 /usr/lib/nfs/nfs4cbd
daemon 117 1 0 19:19:23 ? 0:01 /usr/lib/crypto/kcfd
root 356 342 0 19:19:34 ? 0:00 /usr/lib/saf/ttymon
root 370 7 0 19:19:34 console 0:00 /usr/lib/saf/ttymon -g -d /dev/console -l console -m ldterm,ttcompat -h -p ssyb
daemon 321 1 0 19:19:33 ? 0:00 /usr/lib/nfs/lockd
root 159 1 0 19:19:23 ? 0:01 /usr/sbin/nscd
root 228 1 0 19:19:25 ? 0:00 /usr/sbin/cron
root 358 1 0 19:19:34 ? 0:00 /usr/lib/utmpd
root 157 1 0 19:19:23 ? 0:00 /usr/lib/sysevent/syseventd
root 170 1 0 19:19:24 ? 0:01 /usr/lib/picl/picld
daemon 317 1 0 19:19:32 ? 0:00 /usr/lib/nfs/nfsmapid
root 365 364 0 19:19:34 ? 0:00 /usr/sadm/lib/smc/bin/smcboot
root 220 1 0 19:19:25 ? 0:00 /usr/lib/efcode/sparcv9/efdaemon
root 342 7 0 19:19:34 ? 0:00 /usr/lib/saf/sac -t 300
carlosap 1030 1028 0 21:05:53 pts/2 0:00 -bash
root 453 1 0 19:19:40 ? 0:00 /usr/sbin/vold -f /etc/vold.conf
root 482 1 0 19:19:41 ? 0:00 /usr/sbin/syslogd
root 444 1 0 19:19:40 ? 0:00 /usr/lib/autofs/automountd
root 445 444 0 19:19:40 ? 0:00 /usr/lib/autofs/automountd
noaccess 837 1 0 19:19:55 ? 1:38 /opt/se6000/java_1.5.0/usr/java/bin/java -server -Xms64m -Xmx512m -XX:+Backgrou
root 562 1 0 19:19:42 ? 0:00 /usr/lib/snmp/snmpdx -y -c /etc/snmp/conf
root 540 1 0 19:19:41 ? 0:00 /usr/lib/sendmail -bd -q15m
root 559 1 0 19:19:42 ? 0:00 /usr/sfw/sbin/snmpd
root 502 1 0 19:19:41 ? 0:05 /opt/SUNWsefms/sbin/./wrapper-solaris-sparc-32 /opt/SUNWsefms/sbin/../System/wr
root 965 523 0 20:06:57 ? 0:00 /usr/lib/ssh/sshd
root 523 1 0 19:19:41 ? 0:00 /usr/lib/ssh/sshd
carlosap 1042 1030 0 21:31:18 pts/2 0:00 ps -ef
root 532 502 0 19:19:41 ? 1:13 /opt/se6000/java_1.5.0/usr/java//bin/java -DSUNWsefms=../ -Xms8m -Xmx128m -Djav
carlosap 1028 1025 0 21:05:53 ? 0:00 /usr/lib/ssh/sshd
root 548 1 0 19:19:41 ? 0:04 /usr/lib/fm/fmd/fmd
root 580 1 0 19:19:42 ? 0:00 /usr/lib/dmi/dmispd
root 584 1 0 19:19:42 ? 0:00 /usr/lib/dmi/snmpXdmid -s ssybl0.ssy.gob.mx
root 620 1 0 19:19:45 ? 0:06 /opt/SMgr/agent/jre/bin/java -classpath /opt/SMgr/agent/SMagent.jar devmgr.laun
root 1025 523 0 21:05:50 ? 0:00 /usr/lib/ssh/sshd
root 975 970 0 20:09:55 pts/1 0:00 -bash
carlosap 970 968 0 20:07:00 pts/1 0:00 -bash
root 666 1 0 19:19:46 ? 0:00 /usr/dt/bin/dtlogin -daemon

Search all instances of sshd
pgrep sshd the same effect like ps -ef |grep sshd


[ssybl0:~]# pgrep sshd
968
965
523
1028
1025


[ssybl0:~/docs]$ prtdiag
System Configuration: Sun Microsystems sun4v Sun Blade T6300 Server Module
Memory size: 3968 Megabytes

================================ Virtual CPUs ================================

CPU ID Frequency Implementation Status
—— ——— ———————- ——-
0 1000 MHz SUNW,UltraSPARC-T1 on-line
1 1000 MHz SUNW,UltraSPARC-T1 on-line
2 1000 MHz SUNW,UltraSPARC-T1 on-line
3 1000 MHz SUNW,UltraSPARC-T1 on-line
4 1000 MHz SUNW,UltraSPARC-T1 on-line
5 1000 MHz SUNW,UltraSPARC-T1 on-line
6 1000 MHz SUNW,UltraSPARC-T1 on-line
7 1000 MHz SUNW,UltraSPARC-T1 on-line
8 1000 MHz SUNW,UltraSPARC-T1 on-line
9 1000 MHz SUNW,UltraSPARC-T1 on-line
10 1000 MHz SUNW,UltraSPARC-T1 on-line
11 1000 MHz SUNW,UltraSPARC-T1 on-line
12 1000 MHz SUNW,UltraSPARC-T1 on-line
13 1000 MHz SUNW,UltraSPARC-T1 on-line
14 1000 MHz SUNW,UltraSPARC-T1 on-line
15 1000 MHz SUNW,UltraSPARC-T1 on-line
16 1000 MHz SUNW,UltraSPARC-T1 on-line
17 1000 MHz SUNW,UltraSPARC-T1 on-line
18 1000 MHz SUNW,UltraSPARC-T1 on-line
19 1000 MHz SUNW,UltraSPARC-T1 on-line
20 1000 MHz SUNW,UltraSPARC-T1 on-line
21 1000 MHz SUNW,UltraSPARC-T1 on-line
22 1000 MHz SUNW,UltraSPARC-T1 on-line
23 1000 MHz SUNW,UltraSPARC-T1 on-line

======================= Physical Memory Configuration ========================
Segment Table:
————————————————————–
Base Segment Interleave Bank Contains
Address Size Factor Size Modules
————————————————————–
0×0 4 GB 4 2 GB MB/CMP0/CH0/R0/D0
MB/CMP0/CH0/R0/D1
2 GB MB/CMP0/CH3/R0/D0
MB/CMP0/CH3/R0/D1

========================= IO Configuration =========================

IO
Location Type Slot Path Name Model
———– —– —- ——————————————— ————————- ———
MB/NET0 PCIE MB /pci@780/pci@0/pci@1/network@0 network-pciex8086,105e
MB/NET1 PCIE MB /pci@780/pci@0/pci@1/network@0,1 network-pciex8086,105e
MB/PCI-EM0 PCIE 0 /pci@780/pci@0/pci@9/SUNW,emlxs@0 SUNW,emlxs-pci10df,fc20 LPem11002+
MB/PCI-EM0 PCIE 0 /pci@780/pci@0/pci@9/SUNW,emlxs@0,1 SUNW,emlxs-pci10df,fc20 LPem11002+
MB/USB0 PCIE MB /pci@7c0/pci@0/pci@1/pci@0/usb@0 usb-pciclass,0c0310
MB/USB1 PCIE MB /pci@7c0/pci@0/pci@1/pci@0/usb@0,1 usb-pciclass,0c0310
MB/USB2 PCIE MB /pci@7c0/pci@0/pci@1/pci@0/usb@0,2 usb-pciclass,0c0320
MB/SAS-SATA PCIE MB /pci@7c0/pci@0/pci@2/scsi@0 scsi-pciex1000,58 LSI,1068E

============================ Environmental Status ============================
Fan sensors:
All fan sensors are OK.

Temperature sensors:
All temperature sensors are OK.

Current sensors:
All current sensors are OK.

Voltage sensors:
All voltage sensors are OK.

============================ FRU Status ============================
All FRUs are enabled.


…. NEXt PACKAGE MGMT ……

System Info Commands

### SYSTEM INFO COMMANDS ###

Solaris version and platform information


[ssybl0:~]# cat /etc/release
Solaris 10 5/08 s10s_u5wos_10 SPARC
Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
Use is subject to license terms.
Assembled 24 March 2008

showrev

[ssybl0:~]# showrev
Hostname: bl0
Hostid: 84avaa
Release: 5.10
Kernel architecture: sun4v
Application architecture: sparc
Hardware provider: Sun_Microsystems
Domain:
Kernel version: SunOS 5.10 Generic_127127-11

### Determine configured memory (includes physical memory)

1. prtconf

[ssybl0:~]# prtconf
System Configuration: Sun Microsystems sun4v
Memory size: 3968 Megabytes
System Peripherals (Software Nodes):

SUNW,Sun-Blade-T6300
scsi_vhci, instance #0
ib, instance #0 (driver not attached)
packages (driver not attached)
SUNW,builtin-drivers (driver not attached)
deblocker (driver not attached)
disk-label (driver not attached)
terminal-emulator (driver not attached)
dropins (driver not attached)
SUNW,asr (driver not attached)
kbd-translator (driver not attached)
obp-tftp (driver not attached)
ufs-file-system (driver not attached)
chosen (driver not attached)
openprom (driver not attached)
client-services (driver not attached)
options, instance #0
aliases (driver not attached)
memory (driver not attached)
virtual-memory (driver not attached)
virtual-devices, instance #0
flashprom (driver not attached)
channel-devices, instance #0
virtual-channel (driver not attached)
virtual-channel-client, instance #1
virtual-channel (driver not attached)
console, instance #0
rtc (driver not attached)
fma, instance #0
sunvts (driver not attached)
sunmc (driver not attached)
explorer (driver not attached)
led (driver not attached)
flashupdate (driver not attached)
ncp, instance #0
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
cpu (driver not attached)
pci, instance #0
pci, instance #0
pci, instance #1
network, instance #0
network, instance #1
pci, instance #2
pci, instance #3
pci, instance #4
SUNW,emlxs, instance #0
fp (driver not attached)
disk (driver not attached)
fp, instance #2
ssd, instance #0
ssd, instance #2
SUNW,emlxs, instance #1
fp (driver not attached)
disk (driver not attached)
fp, instance #0
ssd, instance #1
ebus, instance #0
serial, instance #0 (driver not attached)
pci, instance #1
pci, instance #5
pci, instance #6
pci, instance #0
usb, instance #0
usb, instance #1
usb, instance #0
pci, instance #7
scsi, instance #0
tape (driver not attached)
disk (driver not attached)
sd, instance #1
pci, instance #8
pci, instance #9
os-io (driver not attached)
iscsi, instance #0
pseudo, instance #0
[ssybl0:~]# prtconf | grep -i memory
Memory size: 3968 Megabytes
memory (driver not attached)
virtual-memory (driver not attached)


Determine installed processors ( includes physical/virtual processors )


[ssybl0:~]# psrinfo
0 on-line since 08/22/2008 19:19:05
1 on-line since 08/22/2008 19:19:07
2 on-line since 08/22/2008 19:19:07
3 on-line since 08/22/2008 19:19:07
4 on-line since 08/22/2008 19:19:07
5 on-line since 08/22/2008 19:19:07
6 on-line since 08/22/2008 19:19:07
7 on-line since 08/22/2008 19:19:07
8 on-line since 08/22/2008 19:19:07
9 on-line since 08/22/2008 19:19:07
10 on-line since 08/22/2008 19:19:07
11 on-line since 08/22/2008 19:19:07
12 on-line since 08/22/2008 19:19:07
13 on-line since 08/22/2008 19:19:07
14 on-line since 08/22/2008 19:19:07
15 on-line since 08/22/2008 19:19:07
16 on-line since 08/22/2008 19:19:07
17 on-line since 08/22/2008 19:19:07
18 on-line since 08/22/2008 19:19:07
19 on-line since 08/22/2008 19:19:07
20 on-line since 08/22/2008 19:19:07
21 on-line since 08/22/2008 19:19:07
22 on-line since 08/22/2008 19:19:07
23 on-line since 08/22/2008 19:19:07

Physical Procesors:

prtinfo -p

virtual processors

prtinfo -pv

[ssybl0:~]# psrinfo -pv
The physical processor has 24 virtual processors (0-23)
UltraSPARC-T1 (cpuid 0 clock 1000 MHz)


isainfo - describe instruction set architectures

[ssybl0:~]# isainfo
sparcv9 sparc
[ssybl0:~]# isainfo -bv
64-bit sparcv9 applications
asi_blk_init

ssybl2:~]$ isainfo -bv
64-bit amd64 applications
cx16 sse3 sse2 sse fxsr amd_3dnowx amd_3dnow amd_mmx mmx cmov amd_sysc
cx8 tsc fpu

[ssybl0:~]# isalist
sparcv9 sparcv8plus sparcv8 sparcv8-fsmuld sparcv7 sparc sparcv9+vis sparcv9+vis2 sparcv8plus+vis sparcv8plus+vis2

[ssybl2:~]$ isalist
amd64 pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86

#### Determine and change system timestamp ###

1. date - to reveal current timestamp
2. date ‘+DateTime: %m.%d.%Y @ %H:%M.%S’
3. date mmddHHMMccyy
4. date 050817252006

BASH .bash_profile


[ssybl0:~]# cat .bash_profile
export TERM=xtermc
export PS1=’[\h:\w]\$ ‘
alias ls=’ls -l’
alias vi=’vim’

Configuración BLADE

Brocade 200E Fibre Channel Switch

Brocade 200E Fibre Channel Switch

Designed to meet the needs of small and growing SAN environments, the Brocade 4 Gb/sec 200E Fibre Channel switch delivers low-cost access to SAN technology. The switch scales from 8 to 16 ports, is easy to use and install, and is ideal for small and medium-sized organizations deploying their first SAN or expanding their current one.
At A Glance

* Low-cost, high-performance switch designed for small SAN environments
* Scales from 8 to 12 or 16 ports
* Advanced Web tools ease installation and maintenance
* Auto-sensing Fibre Channel switching at 1, 2, and 4 Gb/sec
* Inter-Switch Link Trunking enables high-speed data path up to 16 Gb/sec

Key Applications

* Backup and Restore
* DAS to SAN Migration
* High Availability
* Server/Storage Consolidation

Average Customer Rating
Product Rating

1 star
(1 Rating)
Write a Review
Read 1 Review
Key Industries

* Education
* Financial Services
* Global Government
* Healthcare
* Manufacturing
* Media, Entertainment, and Internet Services
* Retail
* Transportation and Travel

MySQL Solaris Tools

http://www.sun.com/systems/solutions/mysql/tools.jsp

status of CPUs SOlaris

If you want separate stats for each processor, “mpstat 5″ shows cpu usage and idle etc.

System Administration Commands mpstat(1M)

NAME
mpstat - report per-processor or per-processor-set statis-
tics

-bash-3.00# mpstat
CPU minf mjf xcal intr ithr csw icsw migr smtx srw syscl usr sys wt idl
0 17 0 110 234 131 11 0 1 2 0 32 0 1 0 99
1 1 0 17 7 4 6 0 0 0 0 8 0 1 0 99
2 0 0 3 4 2 2 0 0 0 0 4 0 0 0 100
3 0 0 0 1 0 1 0 0 0 0 1 0 0 0 100
4 13 0 50 10 0 20 0 0 1 0 32 0 0 0 100
5 1 0 3 3 0 4 0 0 0 0 7 0 0 0 100
6 0 0 0 1 0 0 0 0 0 0 1 0 0 0 100
7 0 0 0 1 0 0 0 0 0 0 0 0 0 0 100
8 10 0 44 16 0 33 0 0 1 0 44 0 0 0 100
9 1 0 3 4 0 6 0 0 0 0 6 0 0 0 100
10 0 0 0 1 0 1 0 0 0 0 1 0 0 0 100
11 0 0 0 1 0 0 0 0 0 0 1 0 0 0 100
12 10 0 39 7 1 12 0 0 1 0 25 0 0 0 100
13 1 0 2 5 0 10 0 0 0 0 5 0 0 0 100
14 0 0 0 2 0 2 0 0 0 0 1 0 0 0 100
15 0 0 0 1 0 0 0 0 0 0 0 0 0 0 100
16 10 0 44 18 0 37 0 0 1 0 24 0 0 0 100
17 1 0 1 2 0 2 0 0 0 0 3 0 0 0 100
18 0 0 0 1 0 0 0 0 0 0 1 0 0 0 100
19 0 0 0 1 0 0 0 0 0 0 0 0 0 0 100
20 10 0 47 20 0 41 0 0 1 0 32 0 0 0 100
21 1 0 1 2 0 2 0 0 0 0 4 0 0 0 100
22 0 0 0 1 0 0 0 0 0 0 1 0 0 0 100
23 0 0 0 1 0 0 0 0 0 0 0 0 0 0 100

System Administration Commands psrinfo(1M)

NAME
psrinfo - displays information about processors

SYNOPSIS
psrinfo [-p] [-v] [processor_id...]

psrinfo [-p] -s processor_id

DESCRIPTION
psrinfo displays information about processors. Each physical
processor may support multiple virtual processors. Each vir-
tual processor is an entity with its own interrupt ID, capa-
ble of executing independent threads.

Without the processor_id operand, psrinfo displays one line
for each configured processor, displaying whether it is on-
line, non-interruptible (designated by no-intr), spare,
off-line, faulted or powered off, and when that status last
changed. Use the processor_id operand to display information
about a specific processor. See OPERANDS.

-bash-3.00# psrinfo
0 on-line since 08/21/2008 16:18:36
1 on-line since 08/21/2008 16:18:38
2 on-line since 08/21/2008 16:18:38
3 on-line since 08/21/2008 16:18:38
4 on-line since 08/21/2008 16:18:38
5 on-line since 08/21/2008 16:18:38
6 on-line since 08/21/2008 16:18:38
7 on-line since 08/21/2008 16:18:38
8 on-line since 08/21/2008 16:18:38
9 on-line since 08/21/2008 16:18:38
10 on-line since 08/21/2008 16:18:38
11 on-line since 08/21/2008 16:18:38
12 on-line since 08/21/2008 16:18:38
13 on-line since 08/21/2008 16:18:38
14 on-line since 08/21/2008 16:18:38
15 on-line since 08/21/2008 16:18:38
16 on-line since 08/21/2008 16:18:38
17 on-line since 08/21/2008 16:18:38
18 on-line since 08/21/2008 16:18:38
19 on-line since 08/21/2008 16:18:38
20 on-line since 08/21/2008 16:18:38
21 on-line since 08/21/2008 16:18:38
22 on-line since 08/21/2008 16:18:38
23 on-line since 08/21/2008 16:18:38

mysql zfs solaris

http://dev.mysql.com/tech-resources/articles/mysql-zfs.html

( Global Config FIle for ALL SHELLS )

1. Launch shell (BASH / Bourne / C / KSH / TCSH )
2. Solaris sets up the user’s environment - /etc/profile
3. Shell searches for ~/.bash_profile (BASH) , ~/.profile

4. prompt is presented to user

env


Sun Microsystems Inc. SunOS 5.10 Generic January 2005
-bash-3.00# env
HZ=
SHELL=/usr/bin/bash
TERM=xtermc
MAIL=/usr/mail/root
PATH=/opt/csw/bin:/usr/sbin:/usr/bin:/usr/dt/bin:/usr/openwin/bin:/usr/ccs/bin
PWD=/root
TZ=Mexico/General
SHLVL=1
HOME=/root
LOGNAME=root
_=/usr/bin/env


set

-bash-3.00# set
BASH=/usr/bin/bash
BASH_ARGC=()
BASH_ARGV=()
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]=”3″ [1]=”00″ [2]=”16″ [3]=”1″ [4]=”release” [5]=”sparc-sun-solaris2.10″)
BASH_VERSION=’3.00.16(1)-release’
COLUMNS=96
DIRSTACK=()
EUID=0
GROUPS=()
HISTFILE=/root/.bash_history
HISTFILESIZE=500
HISTSIZE=500
HOME=/root
HOSTNAME=bl0
HOSTTYPE=sparc
HZ=
IFS=$’ \t\n’
LINES=36
LOGNAME=root
MACHTYPE=sparc-sun-solaris2.10
MAIL=/usr/mail/root
MAILCHECK=60
OPTERR=1
OPTIND=1
OSTYPE=solaris2.10
PATH=/opt/csw/bin:/usr/sbin:/usr/bin:/usr/dt/bin:/usr/openwin/bin:/usr/ccs/bin
PIPESTATUS=([0]=”0″)
PPID=29885
PS1=’\s-\v\$ ‘
PS2=’> ‘
PS4=’+ ‘
PWD=/root
SHELL=/usr/bin/bash
SHELLOPTS=braceexpand:emacs:hashall:histexpand:history:interactive-comments:monitor
SHLVL=1
TERM=xtermc
TZ=Mexico/General
UID=0
_=echo

Note: use env || set to reveal environmental variables

next Bash SHELL BASICS 2

BASH Shell Command Chaining

###BASH Command Chaining/Logical ANDing/ORing###

Command Chaining:

TO run a -> b -> c

ls -lF /etc; pwd;who;ps


Logical ANDing:

Program b will execute only if program a was executed
a&&b&&c

Programs mutually inclusive
Returns a exit status 0 and then run b exit status 0 and then run C

Logical ANDing - runs subsequent based on exit status of 0

ls -l /etc/resolv.conf && grep name /etc/resolv.conf


Logical ORing:

Run subsequent program based on failure of previous

ls -l /etc/resolve.conf || grep name /etc/resolv.conf

Example:

If the file text.txt doesnt exist you can create with ORing

ls -l test.txt || touch test.txt

Combining ANDing ORing

-bash-3.00$ ls -l text.txt || touch test.txt && ls -ltr test.txt
text.txt: No such file or directory
-rw-r--r-- 1 carlosap other 0 Aug 22 00:13 test.txt


BASH for LOOPS

text.txt
1
2
3

LOOPS SYNTAX:
for variable in list; do command variable; done


-bash-3.00$ for i in `cat test.txt`; do echo $i; done
1
2
3
-bash-3.00$ for i in `cat test.txt`; do echo test$i; done
test1
test2
test3