You are on page 1of 2

NEST207 LAB - 06

 Login to VCloud and use VApp used for previous lab


 All the screenshots should be legible, without any errors and should have your VCloud VApp name at the
top of the browser OR/AND with the terminal command prompt visible and legible in all screenshots with
command and output in full.
 Snipping tool is advised for the screen shots, NO full page/full desktop screenshot.
 For LAB REPORT, the screenshots should be pasted in Word Document in order of the lab questions and
submitted in Blackboard as a single document only. Plagiarism is awarded zero.
 Do NOT login as root or user with UID=0 to do the lab, use sudo ONLY when required.
 The lab(s) MUST be done using your own username as instructed in Lab-1.
 Need to refer to the course resources.
Login to Toronto VM
PART A: System Monitoring: PROCESS
1. Use ps command with various options as below and observe the differences in output. Get familiarized with
the fields/columns using manual pages of ps. Use pipe with head -4 to display only the top four lines
including the heading in the command.
a. ps –e |head -4 b. ps -f | head -4 c. ps –ef |head -4 d. ps –a |head -4
e. ps –u |head -4 f. ps –x |head -4 g. ps –X |head -4 h. ps –ax |head -4
i. ps –aX |head -4 j. ps –eao ppid,pid,uid,stat,cmd,tty,user |head
k. ps –afo ppid,pid,uid,stat,cmd,tty,user |head
2. Find the version of ps
3. Display 3 processes with different states (SCREENSHOT)
4. Use pidof and pgrep to find pid of NetworkManager, cupsd, crond and systemd (SCREENSHOT)
5. Use pstree command to find the parent of NetworkManager, cupsd, sshd, crond (SCREENSHOT)
SCREENSHOT: history |grep ps
PART-B: jobs, bg, fg & kill.
6. Create atleast 5 jobs using vim and display them (SCREENSHOT), (Note the job ID and PID for later purpose)
a. Display the last job b. Bring the second job to foreground and close the job.

7. Display all the kill signals (SCREENSHOT)


8. Use SIGTERM and SIGKILL signals to stop any two jobs. (SCREENSHOT) (do not stop all jobs leave at least one)
PART-C: System monitoring (When running the commands familiarize yourself with purpose of the commands)
9. Run vmstat every 2 secs for 10 iterations.
10. Run iostat command with at least three various options,
11. Try mpstat and mpstat –P ALL, go through the difference of information
12. Use top command and find the available information
13. Use top to display only process with PID 2 (SCREENSHOT)

Page 1 of 2
NEST207 LAB - 06

14. Use top to display only the processes you own (SCREENSHOT first five lines with command)
15. Delay the top process by 10 secs (SCREENSHOT: output of jobs command)

16. Using top stop the job you had created using vim (SCREENSHOT end of top showing killed & jobs command)
17. Display users connect time a) for each day b) totals for each user c) total for all days (SCREENSHOT)
18. Display System monitor, click on each of the three tabs and analyze the information. (SCREENSHOT of all
the three – Process, Resources and File Systems)
SCREENSHOT: screenshot only output related to PART-C of command history | grep -E 'stat|top|ac'
PART-D: SYSTEM LOGGING
19. List the log files and analyze the available files.
20. Note that lastlog file in /var/log is not a text file, to view the file use lastlog command
21. Similarly, for /var/log/wtmp is also not a text file. Type man wtmp and note the purpose of the file.

22. Similarly, for /var/log/btmp type man lastb and find the purpose of btmp file.
23. View the /var/log/messages and analyze the contents in the file.
24. List the logging configuration files (SCREENSHOT)
25. Type logger “This message is from LAB-6 on `date` by `echo $LOGNAME`” and display the line in
/var/log/messages. (SCREENSHOT)
26. Type sudo tail -f /var/log/messages and open another terminal and su – user2 (create user with password
if not available) and note the logging information in messages file. Type exit and exit to close the second
terminal. You can use CTL+C to exit the tail -f. (SCREENSHOT: tail -f output when user2 logs in)
27. Analyze the three sections of the logging configuration file and familiarise the facilities and level(s) defined
therein. Use man logger to get more info on the logger command, facilities, and levels.
28. Analyze the manual pages logrotate, logger, syslog (3) and rsyslogd
29. Display the pid and status of logging daemon (SCREENSHOT)
30. Analyze the logrotate configuration file for the rotation period given. Also find the rotation interval for
/var/log/wtmp, /var/log/btmp and yum (dnf). (SCREENSHOT the rotation config for wtmp, btmp and yum)
31. Display journald configuration file and its service (SCREENSHOT)
32. Retrieve messages from journal and display it (SCREENSHOT first 5 lines)
33. Display alerts generated by rsyslog, sshd, NetworkManager, tuned using journalctl.
34. Display System tuning's service status (SCREENSHOT)
35. List available tuning profiles and active tuning profiles using tuned-adm (SCREENSHOT)
36. List the files and directory where predefined tuned profiles and custom tuned profiles (SCREENSHOT)
SCREENSHOT: a) history |grep log b) history |grep -E 'journal|tuned' c) history |grep man (only Part-D)

Page 2 of 2

You might also like