Sie sind auf Seite 1von 3

Basic sysadmin command questions 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 n oon 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 t he shell script, sa1. This script invokes sadc and writes to the daily data fi les, /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 a ctivity 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 passw ord 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 c drom -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 us age 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 dire ctory 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 subseque nt new objects. The garbage collector must somehow determine which objects a re no longer referenced by the program and make available the heap space oc cupied by such unreferenced objects. In the process of freeing unreferenced obj ects, the garbage collector must run any finalizers of objects being freed. ================================ ================================

Das könnte Ihnen auch gefallen