The goal of this assignment is to "peek under the hood" by using various user level tools that monitor system state in both Linux and Windows. You will be asked to use various tools to see how many processes are running, how much memory those processes are using, etc. The questions themselves should be fairly straightforward (especially if you've used these tools before). Hopefully, everyone will learn at least a few tools that they didn't know before!
You may want to consider making a copy of this document (even a text copy if necessary) and cutting and pasting answers from the screen into the document. We may ask you to submit a hardcopy, but it will still make doing the exercise easier.
The point of this exercise is not really to answer the questions correctly but rather to familiarize you with system monitoring tools that will be helpful in illustrating various aspects of this course. So don't worry too much about the details and don't spend too much time on it! I would expect the entire exercise to take no more than 1 - 1 1/2 hours.
For each question, you may need to consult the man page for the command referenced.
To view the man page for the uname command you type man uname
, to search for a man page for something to do with process you type man -k process
.
Bring up a command window from Applications -> System Tools -> Terminal. Use the
hostname
command to find the name of the computer you are using. Try variations on the hostname command, like hostname -a
or hostname -f
or hostname --help
to find out what else you can do.
Use the uname
command to determine the following
uname -sr
)uname -m
)uname -n
return?Using the uptime
command determine the following
Use the mount
and the df
commands (df -h
is especially nice if it works) to determine the following:
/
)? mount
)Use the vmstat
command to determine the following
vmstat 5 5
to report statistics 5 times in a row with a 5 second delay. Which, if any, of the statistics reported change during the time you watch?Bring up another command window. In the first, run the command top
. (Note: Cntrl-C or q will exit top.)
mozilla
, an editor like emacs
, running a grep
or a find
etc.). Describe changes in the top output.
Run gnome-system-monitor
, a GUI version of top (Note: You will need to be sitting at the machine or able to run a remote Xserver). Experiment with the tabs Process Listing and Resource Monitor; look in the Devices section of the Resource Monitor tab to see free space. Look at the colors used in the various color graph lines.
Use the ps
command to determine the following information. (Try ps
and ps -efl
or maybe ps aux
).
ps
to determine what the process state abbreviations S, R and Z mean? (man ps
)ps -efl
will show process id, PID, as well as parent process id, PPID. pstree described below will also help you with this.)ps aux | grep your_username
) You can find your username using whoami
(or combine all the commands like this: ps aux | grep `whoami`
).
vi
, find / -name foo -print
, emacs
, mozilla
etc.). Rerun ps
and find them in the output. Note their start time and running time.
Use the pstree
command to examine the family tree of all the processes in the system.
ps
again and find this process in the output. Record all of its attributes.
xterm
from another, then another from that one, etc. Rerun pstree
and record the branch with the processes you just created.
Use the netstat
command.
netstat
alone to list the open connections. If you are logged in remotely find the connections to the machine you are connecting from. If you are sitting at the machine, try logging in remotely to another machine and locating that connection. Record the properties of one such connection.netstat -rn
to display the routing table. What is the default gateway for this machine?Many of these monitoring utilities find the information they provide via the /proc file system. /proc contains file and directories which export some kernel level variables. Type: cd /proc
man proc
)ls /proc
). Notice all the numbered directories. Each number corresponds to a process id. Determine the process id of your command shell. Execute ls
then ls -al
of /proc/PROCESSIDOFYOURSHELL/fd.ps
command is implemented?You'll need xosview
to answer the following questions, you can run the script do-xosview.sh to get and compile xosview (this can only be done on a linux machine). Download this script, then run like this chmod +x do-xosview.sh; ./do-xosview.sh
You may also want to experiment with some of the following commands: kill
(can you make a zombie process?), dmesg
, procinfo
, hdparm
, sysinfo
, strace
.
You may also want to experiment with some interesting network commands: /sbin/route
, /sbin/arp
, /sbin/ifconfig
, /sbin/rarp
, /sbin/iptables
, /usr/sbin/tcpdump
, hostname
, traceroute6
, nslookup
.
Open a command prompt (Start..Programs..Accessories..Command Prompt). Run hostname
and record the name of the computer you are using.
Run winmsd
and explore the variety of information available.
Run taskmgr
(You can also start the task manager by typing Cntl-Alt-Delete
).
Run perfmon
. Within the chart, right click and select "Add Counter". Notice that there are a variety of performance objects.
Download pview, Windows
Process Explode and execute pview
. Also search for
pview.exe on the lab machines (Search..Files or Folders C:\Program Files\).
Word
, netscape
, IE
, Excel
, etc.) and record how many new threads they have. Do any of those applications cause the creation of more than one new process?Run netstat at the command prompt.
netstat
alone to list the open connections. If you are logged in remotely find the connections to the machine you are connecting from. If you are sitting at the machine, try logging in remotely to another machine and locating that connection. Record the properties of one such connection.netstat -rn
to display the routing table. What is the default gateway for this machine?Explore the following tools if available: sc
(service control) for manipulating services, cacls\xcacls
for manipulating file permissions, netcps
(freeware) for diagnosing networking performance issues, cpustres
for creating cpu load, diruse
for returning the size of a directory and all its children, top
(much like on UNIX), qslice
, showacls
, srvnay
, uptime
(try also "uptime \\anothermachine"), where
, kernprof
, i386kd
and windbg
.
Consult http://www.microsoft.com/windows2000/techinfo/reskit/rktour/server/S_tools.asp for a list of Microsoft resource kit tools and http://www.sysinternals.com for a nice collection of non-Microsoft monitoring tools like DebugView and Filemon.