System Admin Commands PDF Print E-mail
Written by Administrator   
Saturday, 21 March 2009 01:42
   1 
   2 
   3 
   4 
   5 
   6 
   7 
   8 
   9 
  10 
  11 
  12 
  13 
  14 
  15 
  16 
  17 
  18 
  19 
  20 
  21 
  22 
  23 

  24 
  25 
  26 

  27 

  28 

  29 

  30 



  31 

  32 

  33 
  34 
  35 
  36 
  37 
  38 
  39 
  40 
  41 

  42 
  43 
  44 
  45 
  46 
  47 
  48 
  49 
  50 
  51 


  52 
  53 
  54 
  55 
  56 
  57 
  58 
  59 

  60 
  61 
  62 
  63 
  64 

  65 
  66 
  67 
  68 

  69 
  70 
  71 
  72 
  73 
  74 
  75 
  76 
  77 
  78 
  79 
  80 
  81 
  82 
  83 
  84 
  85 
  86 
  87 
  88 
  89 
  90 
  91 
  92 
  93 
  94 
  95 
  96 
  97 
  98 
  99 
 100 





 101 
 102 
 103 
 104 
 105 
 106 
 107 
Questions
1. What are the different ways to check the load average on a system?
vmstat, top, uptime, w, procinfo
================================
================================
    
Bonus - Describe the 3 values that top/uptime shows
1-minute, 5-minute and 15-minute load averages
================================
================================
    
2. What are the different running states of a SOLARIS system?
1,2, and 3
================================
================================
    
3. How do you check CPU and MEMORY resources on a server?
Memory: dmesg |grep mem, prtdiag |grep Memory, prtconf -v |grep Mem
CPU: /usr/sbin/psrinfo -v
================================
================================
     
4. How do you obtain system activity for a particular time frame (Say noon to 
  10PM)?
For CPU usage:
a) Use the command 'sar'
b) sar consists of three commands that are involved in automatic system activity
  data collection: sadc, sa1, and sa2.
c) To make sure sadc is run at boot time, the /etc/init.d/perf file must contain
  a command line that writes a record to the daily data file.
d) The command entry has the following format: /usr/bin/su sys -c 
  "/usr/lib/sa/sadc /var/adm/sa/sa`date +%d`"
e) This entry is already in the /etc/init.d/perf file, but it needs to be 
  uncommented.
f) Put a line into the /var/spool/cron/crontabs/sys file, which calls the shell 
  script, sa1. This script invokes sadc and writes to the daily data files, 
  /var/adm/sa/sa<dd>. The sa1 script gets installed with the other sar packages 
  and has the following syntax: /usr/lib/sa/sa1 [t n]
g) The syntax for the sar command is as follows: sar [-aAbcdgkmpqruvwy] [-o 
  <outputfile>] [t n ]
h) So in answer to the original question the command to obtain system activity 
  from 12:00 PM to 10:00 PM is as follows: sar -s 12 -e 22 -i 3600 -A
================================
================================
    
5. What does an init 5 do?
shutdown the system, it will sync the file system first.
================================
================================
     
6. How do you reset the root password on a server? No one has the password or 
  has forgotten it. SUDO is not configured on the server as well.
a) Insert Solaris CD in cd drive and from ok prompt run command: boot cdrom -s
b) This will take you single user mode
# fsck /dev/rdsk/c0t0d0s0.
Answer y to clear all.
c) mount /dev/dsk/c0t0d0s0 /a
d) cd /a/etc
e) TERM=sun
f) export TERM
g) vi /a/etc/shadow
Remove password (between the first two colons i.e.., 
  root:WYlPW5T2EyiU6:13750::::::) from password field of root and save file with
  wq!
h) cd /
i) umount /a
j) init 6
You will be prompted for password for root.
================================
================================
     
7. How do you check disk usage. How do you trouble shoot a high disk usage issue
  (Available disk space is at 2% and could crash the application)
First see which partiton is full
du -hk
To find out which files/folders are taking up the most space
/du -dk / | sort -n
To delete files older than x number of days in the current working directory and
  below, the safe way is
With -mtime
find . ! -mtime -<days>    | /usr/bin/xargs rm -rf
With -exec and -newer
create file with appropriate time stamp, this one would be for midnight last 
  night
touch -t 200903200000 /tmp/timeref
to test first
find . ! -newer /tmp/timeref -exec ls -l {} \; | more
to delete
find . ! -newer /tmp/timeref -exec rm {} \;
================================
================================
     
8. How do you check the ports in use on a server?
netstat -an
================================
================================

9. What is NDD?
Make the changes to the running system.
# ndd -set /dev/hme adv_100hdx_cap 0
# ndd -set /dev/hme adv_100fdx_cap 1
# ndd -set /dev/hme adv_autoneg_cap 0
# ndd -get /dev/hme link_mode
Interpretation:
0 -- half-duplex
1 -- full-duplex
# ndd -get /dev/hme link_speed
Interpretation:
0 -- 10 Mbit
1 -- 100 Mbit
1000 -- 1 Gbit
================================
================================
     
10. What is garbage collection in Java?
When an object is no longer referenced by the program, the heap space it 
  occupies must be recycled so that the space is available for subsequent new 
  objects. The garbage collector must somehow determine which objects are no 
  longer referenced by the program and make available the heap space occupied by
  such unreferenced objects. In the process of freeing unreferenced objects, the
  garbage collector must run any finalizers of objects being freed.
================================
================================


     
     

Comments
Search
Only registered users can write comments!

!joomlacomment 4.0 Copyright (C) 2009 Compojoom.com . All rights reserved."

 

Founder MJ12Net

Founder MJ12Net.org

Brian Bills
Founder MJ12Net
System Admin

Stumble Us

Valid XHTML & CSS | Template Design ah-68 | Copyright © 2009 by Firma