Sie sind auf Seite 1von 5

Public

1 (5)

SOLARIS COMMANDS
Prepared (also subject responsible if other)

No.

ELC/YGI Serge Dagher


Approved

Checked

Date

Rev

2007-12-14

PA1

Reference

Solaris Commands
A. # df k
a. /var should not exceed 70% to 75%. If it goes above these values, the performance of the msp
will be affected.
B. # du k * or <filename> is used to check the size in Kb.
C. If syslog deamon is hanging then
a. # ps aef | grep syslog
b. # kill HUP <pid of syslog deamon>
D. # sysdef h :gives us the system information, including hardware
E. # hostid : gives us the host ID
F. UNAME
a. # uname p :current system
b. # uname r : current solaris version
G. # uptime : get the system uptime, how long it has been running
H. # who b : gives when the system was started up
I.

# prtconf : prints configuration information to the console

J. # gmesg : to display the last system messages

Public
2 (5)

SOLARIS COMMANDS
Prepared (also subject responsible if other)

No.

ELC/YGI Serge Dagher


Approved

Checked

Date

Rev

2007-12-14

PA1

Reference

K. Crontab:
1. To view: # crontab l
2. To edit: # crontab e
3. To edit cronjob in vi:
a. # export EDITOR=vi (only needed one time)
b. # crontab e
L. How to install SSH
1. Start with rand-600-11.tar.Z
a. # cd /opt
b. # zcat rand-600-11.tar.Z
c. # tar xvf rand-600-11.tar
d. # cd rand
e. # cd 600-11
f. # cd bin
g. # ./install.sh
2. Now with openssh-122-10.tar.Z
a. # cd /opt
b. # zcat openssh-122-10.tar.Z
c. # tar xvf openssh-122-10.tar
d. # cd openssh
e. # cd 122-10
f. # cd bin
g. # ./install.sh
M. How to compress a folder
3. # tar cvf <filename.tar> <directory name>
4. # gzip <filename.tar>
N. How to mount a FDD
5. # volcheck
6. or # mount F pcfs /dev/diskette/floppy0
O. How to enable telnet
7. Check that TERM=vt100
a. # echo $TERM (output should be vt100. if it is not, then do the following)
b. # TERM=vt100
c. # export TERM
d. # echo $TERM (check that TERM=vt100)
8. On the Sun machine
a. # cd /etc/default
b. # vi login

Public
3 (5)

SOLARIS COMMANDS
Prepared (also subject responsible if other)

No.

ELC/YGI Serge Dagher


Approved

Checked

Date

Rev

2007-12-14

PA1

Reference

c. Edit the line CONSOLE = /dev/console by adding a # before CONSOLE then save the
file.
9. On the Sun machine
a. # cd /etc/inet
b. # vi inetd.conf
c. Comment out the Telnet to diasble telnet
P. How to change the prompt, and make aliases
10. on the \ edit the .bashrc
# vi .bashrc
export PS1=\u@\h:\w#
alias ll=ls sl
1.1.1

The meaning of the characters in the prompt string settings

The following list shows the meanings of the special characters used to define the PS1 and PS2 prompt
strings.

\t - time
\d - date
\n - newline
\s - Shell name
\W - The current working directory
\w - The full path of the current working directory.
\u - The user name
\h - Hostname
\# - The command number of this command.
\! - The history number of the current command
Q. How to check the NAFO group
11. # pnmstat l
R. How to diag the system
12. # /usr/platform/sun4u/sbin/prtdiag

S. How to check if a port is open


13. # netstat an | grep <port #>
T. CLUSTER
14. To shutdown the cluster
# scshutdown y g0 (this will bring down all nodes to OK>)
# scswitch -F -g radius-ha (Stops radius resources)
15. To restart the cluster

Public
4 (5)

SOLARIS COMMANDS
Prepared (also subject responsible if other)

No.

ELC/YGI Serge Dagher


Approved

Checked

Date

Rev

2007-12-14

PA1

Reference

# scswitch -Z -g radius-ha (Restart radius resources)


16. To switch master node
# scswitch S h <Hostname of active>
17. To stop a specific resource
# scswitch n j <name of the resource>
18. To start a specific resource
# scswitch e j <name of the resource>
If a resource has failed flag, then a clear of the FAIL should be done. Then a restart
# scswitch c h <hostname> -j <name of resource> -f STOP_FAILED
19. To check disk mirroring
Internal disk: # metastat
External disk: # vxprint
U. How to set up NTP
First check if the timezone is correct or not, if not and you need to add the correct timezone (in the example
I will add more time to Asia)
1. Add more time to Asia
# cd /usr/share/lib/zoneinfo/src
# zic asia
2. Change the TZ
# vi /etc/TIMEZONE
...change TZ i.e. TZ=Asia/Qatar
3. Restart server using init 6 (this is for a single node)

P.S. If we have a cluster, then we should add the timezone to all nodes.
4. To restart a cluster we can do it node by node or shutdown the cluster and boot it again
a. Shutdown the cluster then reboot
# scshutdown y g0 (This will bring down both nodes to the ok > prompt
Ok> boot

b. To restart node by node


Switch the active node
# scswitch S h <from active node>
Check that the cluster have changed node
# scstat
Reboot the first node
# init 6
After complete reboot, switch the active node again
# scswitch S h <from active node>
Check that the cluster have changed node
# scstat
Reboot second node
# init 6
g. Check proper behaviour.
P.S. It is better before shutting down the cluster to stop rtp99 on each noce

start with the inactive node:


# su rtp99
# stopRTP &

Public
5 (5)

SOLARIS COMMANDS
Prepared (also subject responsible if other)

No.

ELC/YGI Serge Dagher


Approved

Checked

Date

Rev

2007-12-14

PA1

Reference

$ exit

Do the same for the active node


Now shutdown the cluster using one of the mentionned methods.
Now we start the set up of NTP
1) Edit the ntp.conf file, and add after the fudge line, the ntp server ip address or ntp server name (if it is
added in the /etc/hosts file)
# vi /etc/inet/ntp.conf
server <ntp IP address1> prefer
server <ntp IP address 2>
2) Save the file
3) Restart the xntpd daemon
# kill -9 xntpd
4) Wait for few seconds and check that the xntpd daemon has restarted
1. # ps ef | grep xntpd

V. How to check for NTP server


1. # ntpq p or # xntpdc p
2. # nptdate (to synchronize, -B to force) < NTP IP address>

Das könnte Ihnen auch gefallen