IMAT5122 Coursework Report: Linux System Change Logger Script Analysis
VerifiedAdded on 2022/10/04
|16
|2229
|46
Report
AI Summary
This report presents an analysis of a Linux system monitoring script, mySysMonitor.sh, designed to log system and network information. The report begins with an introduction to the importance of shell commands in monitoring and administration, followed by a detailed explanation of the script's requirements. The core of the report focuses on the script's functionality, which involves using various UNIX terminal commands to gather data on active processes, resource-intensive processes, connected devices, disk space usage, network interfaces, and other system details. The report justifies the use of each command and then provides screenshots of the script and log files to verify the output. The report concludes by highlighting the utility of shell scripts in providing comprehensive system and network monitoring capabilities. This report is a coursework assignment submitted by a student and available on Desklib, a platform providing AI-powered study tools.
Contribute Materials
Your contribution can guide someone’s learning journey. Share your
documents today.

Running head: NETWORK AND SYSTEM MONITORING
Network and System Monitoring
Name of the Student
Name of the University
Author Note
Network and System Monitoring
Name of the Student
Name of the University
Author Note
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.

1NETWORK AND SYSTEM MONITORING
Abstract
A wide range of researches have proved the importance of UNIX or Linux shell commands
for the purpose of checking various system or even network specific information. Despite
these details also being available through GUI interfaces, shell scripts are found to provide
the complete details and aid in generating logs which automatically show output of shell
commands specified by the script and can be opened by admins any time. The report
concerns a script file mySysMonitor.sh which prints the output of different system based and
networking specific data in the mySysMonitor.log file. In performing this, the report uses
various UNIX based terminal commands and their respective extensions for printing the
desired results. The report then explains the use of these commands. After this different
screenshots are provided by the report showing contents of the script and log files. Thus the
report verifies the log output and ends with concluding notes.
Abstract
A wide range of researches have proved the importance of UNIX or Linux shell commands
for the purpose of checking various system or even network specific information. Despite
these details also being available through GUI interfaces, shell scripts are found to provide
the complete details and aid in generating logs which automatically show output of shell
commands specified by the script and can be opened by admins any time. The report
concerns a script file mySysMonitor.sh which prints the output of different system based and
networking specific data in the mySysMonitor.log file. In performing this, the report uses
various UNIX based terminal commands and their respective extensions for printing the
desired results. The report then explains the use of these commands. After this different
screenshots are provided by the report showing contents of the script and log files. Thus the
report verifies the log output and ends with concluding notes.

2NETWORK AND SYSTEM MONITORING
Table of Contents
Introduction................................................................................................................................3
Requirements..............................................................................................................................4
Solution......................................................................................................................................4
Shell script commands and justification................................................................................7
Currently active processes..................................................................................................7
Five most CPU and RAM hungry processes......................................................................7
All connected devices and USBs.......................................................................................8
Usage of disk space – overall.............................................................................................8
Usage of disk space – Home Directory..............................................................................8
Usage of disk space – Other Directories............................................................................8
Network interfaces and their states....................................................................................8
Other key directories..........................................................................................................8
Screenshots.............................................................................................................................9
mySysMonitor.sh in text editor..........................................................................................9
mySysMonitor.sh through terminal.................................................................................10
mySysMonitor.log in text editor......................................................................................10
mySysMonitor.log through the terminal..........................................................................11
Conclusion................................................................................................................................11
Bibliography.............................................................................................................................13
Table of Contents
Introduction................................................................................................................................3
Requirements..............................................................................................................................4
Solution......................................................................................................................................4
Shell script commands and justification................................................................................7
Currently active processes..................................................................................................7
Five most CPU and RAM hungry processes......................................................................7
All connected devices and USBs.......................................................................................8
Usage of disk space – overall.............................................................................................8
Usage of disk space – Home Directory..............................................................................8
Usage of disk space – Other Directories............................................................................8
Network interfaces and their states....................................................................................8
Other key directories..........................................................................................................8
Screenshots.............................................................................................................................9
mySysMonitor.sh in text editor..........................................................................................9
mySysMonitor.sh through terminal.................................................................................10
mySysMonitor.log in text editor......................................................................................10
mySysMonitor.log through the terminal..........................................................................11
Conclusion................................................................................................................................11
Bibliography.............................................................................................................................13

3NETWORK AND SYSTEM MONITORING
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.

4NETWORK AND SYSTEM MONITORING
Introduction
This report below tries to highlight the importance of UNIX or Linux shell commands
for the purpose of checking various system or even network specific information. The report
begins by specifying the requirements of monitoring and administration of the system and the
network. Here the report concerns a script file mySysMonitor.sh which prints the output of
different system based and networking specific data in the mySysMonitor.log file. In
performing this, the report uses various UNIX based terminal commands and their respective
extensions for printing the desired results. The report then explains the use of these
commands. After this different screenshots are provided by the report showing contents of the
script and log files. Thus the report verifies the log output and ends with concluding notes.
Introduction
This report below tries to highlight the importance of UNIX or Linux shell commands
for the purpose of checking various system or even network specific information. The report
begins by specifying the requirements of monitoring and administration of the system and the
network. Here the report concerns a script file mySysMonitor.sh which prints the output of
different system based and networking specific data in the mySysMonitor.log file. In
performing this, the report uses various UNIX based terminal commands and their respective
extensions for printing the desired results. The report then explains the use of these
commands. After this different screenshots are provided by the report showing contents of the
script and log files. Thus the report verifies the log output and ends with concluding notes.

5NETWORK AND SYSTEM MONITORING
Requirements
The shell script file mySysMonitor.sh must be created such that the file periodically
writes system and network information into a log file named mySysMonitor.log in automatic
ways.
The mySysMonitor.log file is supposed to contain in depth information as also time
related details as per the changes occurring to the processes running currently in background,
five top CPU intensive and RAM heavy applications, all the devices that are currently
plugged to the system, overall disk usage percentage of the system including that of home
directory in particular as also all the other directories. The file is also to include information
based on the network interfaces as also other information that are relevant for monitoring of
the system and network.
This file containing the shell script commands must be built with GNU nano which is
the text editor for UNIX or Linux based operating systems with appropriate headings
specified on top.
The file thus created should be such that the network administrators are able to open
this program by means of simple cat commands in CLI terminals of UNIX or Linux (Ubuntu)
based operating systems.
Solution
The concerned solution involves a file containing shell script commands for printing
various details owing to administration of the system, the as also monitoring of performance
of both system components and network interfaces in the file called mySysMonitor.log. The
aim behind this is to aid in determining if these systems are operating as expected and
whether or not there are presence of suspicious activities running on the existing network
Requirements
The shell script file mySysMonitor.sh must be created such that the file periodically
writes system and network information into a log file named mySysMonitor.log in automatic
ways.
The mySysMonitor.log file is supposed to contain in depth information as also time
related details as per the changes occurring to the processes running currently in background,
five top CPU intensive and RAM heavy applications, all the devices that are currently
plugged to the system, overall disk usage percentage of the system including that of home
directory in particular as also all the other directories. The file is also to include information
based on the network interfaces as also other information that are relevant for monitoring of
the system and network.
This file containing the shell script commands must be built with GNU nano which is
the text editor for UNIX or Linux based operating systems with appropriate headings
specified on top.
The file thus created should be such that the network administrators are able to open
this program by means of simple cat commands in CLI terminals of UNIX or Linux (Ubuntu)
based operating systems.
Solution
The concerned solution involves a file containing shell script commands for printing
various details owing to administration of the system, the as also monitoring of performance
of both system components and network interfaces in the file called mySysMonitor.log. The
aim behind this is to aid in determining if these systems are operating as expected and
whether or not there are presence of suspicious activities running on the existing network

6NETWORK AND SYSTEM MONITORING
interfaces and to find their current state. This monitoring data can consist of the below listed
details about the network and the system:
o Processes currently active on the system
o Five most resource hungry processes (CPU and RAM)
o All devices and USBs connected to the system
o Disk space Usage: The overall disk usage of the system
o Disk space Usage: Home directory usage of disk space
o Disk space Usage: Usage of disk by other key directories
o State of network interfaces and their availability
o Other information relevant to monitoring and administration of the system and
the network
The above details are next then printed into the log file called mySysMonitor.log. Network
administrators can view the contents of the log file as also the shell script file through the
terminals and even the text editors. The file containing the shell script commands -
mySysMonitor.sh contains the following script.
#!/bin/bash
# My System Information
#redirect stdout/stderr to a file
exec &> mySysMonitor.log
echo "Currently active processes - ";
ps
echo " 5 most CPU intensive and RAM hungry processes - ";
interfaces and to find their current state. This monitoring data can consist of the below listed
details about the network and the system:
o Processes currently active on the system
o Five most resource hungry processes (CPU and RAM)
o All devices and USBs connected to the system
o Disk space Usage: The overall disk usage of the system
o Disk space Usage: Home directory usage of disk space
o Disk space Usage: Usage of disk by other key directories
o State of network interfaces and their availability
o Other information relevant to monitoring and administration of the system and
the network
The above details are next then printed into the log file called mySysMonitor.log. Network
administrators can view the contents of the log file as also the shell script file through the
terminals and even the text editors. The file containing the shell script commands -
mySysMonitor.sh contains the following script.
#!/bin/bash
# My System Information
#redirect stdout/stderr to a file
exec &> mySysMonitor.log
echo "Currently active processes - ";
ps
echo " 5 most CPU intensive and RAM hungry processes - ";
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

7NETWORK AND SYSTEM MONITORING
ps aux | sort -rk 3,3 | head -n 6
echo "All connected devices and USBs - ";
lsusb
echo "Usage of disk space - ";
echo "Overall usage of the disk - ";
df -h /dev/sda1
echo "Disk usage of home directory - ";
df -hT /home
echo " Disk usage of other key directories - ";
df -h
echo "Available network interfaces and their present state - ";
ip link show
echo "Other information relevant to the system";
uname –a
As can be found from the above shell script, it addresses all the five criteria out of which the
criteria for disk usage contains a set of three sub criteria which are overall usage of system
disk space, disk space usage of home directory and disk usage of other important directories.
The file mySysMonitor.log according to the shell script file shows the echo message followed
by the corresponding results
ps aux | sort -rk 3,3 | head -n 6
echo "All connected devices and USBs - ";
lsusb
echo "Usage of disk space - ";
echo "Overall usage of the disk - ";
df -h /dev/sda1
echo "Disk usage of home directory - ";
df -hT /home
echo " Disk usage of other key directories - ";
df -h
echo "Available network interfaces and their present state - ";
ip link show
echo "Other information relevant to the system";
uname –a
As can be found from the above shell script, it addresses all the five criteria out of which the
criteria for disk usage contains a set of three sub criteria which are overall usage of system
disk space, disk space usage of home directory and disk usage of other important directories.
The file mySysMonitor.log according to the shell script file shows the echo message followed
by the corresponding results

8NETWORK AND SYSTEM MONITORING
The above file needs to be run using the command - ./mySysMonitor.sh
This creates the mySysMonitor.log file which is generated by the shell script file
Shell script commands and justification
Currently active processes
‘ps’ – To show the processes which are active currently, the UNIX command ‘ps’ can serve a
very useful purpose in Linux based operating systems where ps stands for ‘process status’.
This ps command makes it possible to view details of those processes which are active or
running in the system background. This command lists every process that is currently active
while also showing their PIDs.
Five most CPU and RAM hungry processes
‘ps aux | sort -rk 3,3 | head -n 6’ – The aux part in ‘ps aux | sort -rk 3,3 | head -n 6’ serve to
perform various types of tasks. They can include showing all processes for all users by means
of ‘a’, display of users or owners of numerous processes by means of ‘u’ and showing of
processes that are absent from the terminal by means of ‘x’. After this multiple filters can get
applied through the use of separators denoted by the ‘|’s. The filters can perform sort
The above file needs to be run using the command - ./mySysMonitor.sh
This creates the mySysMonitor.log file which is generated by the shell script file
Shell script commands and justification
Currently active processes
‘ps’ – To show the processes which are active currently, the UNIX command ‘ps’ can serve a
very useful purpose in Linux based operating systems where ps stands for ‘process status’.
This ps command makes it possible to view details of those processes which are active or
running in the system background. This command lists every process that is currently active
while also showing their PIDs.
Five most CPU and RAM hungry processes
‘ps aux | sort -rk 3,3 | head -n 6’ – The aux part in ‘ps aux | sort -rk 3,3 | head -n 6’ serve to
perform various types of tasks. They can include showing all processes for all users by means
of ‘a’, display of users or owners of numerous processes by means of ‘u’ and showing of
processes that are absent from the terminal by means of ‘x’. After this multiple filters can get
applied through the use of separators denoted by the ‘|’s. The filters can perform sort

9NETWORK AND SYSTEM MONITORING
operations by specifying ‘r’ and ‘k’ values. Another filter can be applied by using another
separator.
All connected devices and USBs
lsusb - lsusb makes it possible to display details regarding the USB bus slots which exists in
the system and shows details of all devices connected to them.
Usage of disk space – overall
df - h /dev/sda1 – The command df-h makes it possible for showing total system disk usage.
Here, the ‘/dev/sda1’ extension shows the combined disk space usage of that particular user
directory of the system which usually contain the operating system.
Usage of disk space – Home Directory
df - hT /home – The hT /home extension used shows the output containing usage of disk
space of particularly the home directory.
Usage of disk space – Other Directories
df - h – The command has been used in different forms for the above purposes of finding disk
usages of different directories from the system. Here, no specific directories are mentioned
and hence no specific results are shown that is disk usage of all other directories are
displayed.
States of Network interfaces
ip link show – This shell command is used to display output regarding details of network
interfaces along with the current state of network interfaces.
Other important directories
uname - a – This UNIX command can be used in the terminal for displaying details about
which operating system is installed in the system currently.
operations by specifying ‘r’ and ‘k’ values. Another filter can be applied by using another
separator.
All connected devices and USBs
lsusb - lsusb makes it possible to display details regarding the USB bus slots which exists in
the system and shows details of all devices connected to them.
Usage of disk space – overall
df - h /dev/sda1 – The command df-h makes it possible for showing total system disk usage.
Here, the ‘/dev/sda1’ extension shows the combined disk space usage of that particular user
directory of the system which usually contain the operating system.
Usage of disk space – Home Directory
df - hT /home – The hT /home extension used shows the output containing usage of disk
space of particularly the home directory.
Usage of disk space – Other Directories
df - h – The command has been used in different forms for the above purposes of finding disk
usages of different directories from the system. Here, no specific directories are mentioned
and hence no specific results are shown that is disk usage of all other directories are
displayed.
States of Network interfaces
ip link show – This shell command is used to display output regarding details of network
interfaces along with the current state of network interfaces.
Other important directories
uname - a – This UNIX command can be used in the terminal for displaying details about
which operating system is installed in the system currently.
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.

10NETWORK AND SYSTEM MONITORING
Screenshots
The screenshots provided below verify that the file mySysMonitor.sh thus created and
the log file generated by this script file mySysMonitor.log meets the requirements for the
network administrators. Screenshots of mySysMonitor.log present the outputs of shell
commands listed in script file mySysMonitor.sh.
mySysMonitor.sh in text editor
Screenshots
The screenshots provided below verify that the file mySysMonitor.sh thus created and
the log file generated by this script file mySysMonitor.log meets the requirements for the
network administrators. Screenshots of mySysMonitor.log present the outputs of shell
commands listed in script file mySysMonitor.sh.
mySysMonitor.sh in text editor

11NETWORK AND SYSTEM MONITORING
mySysMonitor.sh through terminal
mySysMonitor.log in text editor
mySysMonitor.sh through terminal
mySysMonitor.log in text editor

12NETWORK AND SYSTEM MONITORING
mySysMonitor.log through the terminal
It can be clearly seen from the above screenshots that all the diagnostic and
configuration data required for the network administrators are easily obtainable as also
additional information regarding the operating system is made available.
Conclusion
In conclusion the above report tries to highlight the importance of UNIX or Linux
shell commands for the purpose of checking various system or even network specific
information. Despite these details also being available through GUI interfaces, shell scripts
are found to provide the complete details and aid in generating logs which automatically
show output of shell commands specified by the script and can be opened by admins any
time. The report is observed to deal with the script file mySysMonitor.sh which prints the
output of different system based and networking specific data in the mySysMonitor.log file.
In performing this, the report uses various UNIX based terminal commands and their
respective extensions for printing the desired results. The report then explains the use of these
mySysMonitor.log through the terminal
It can be clearly seen from the above screenshots that all the diagnostic and
configuration data required for the network administrators are easily obtainable as also
additional information regarding the operating system is made available.
Conclusion
In conclusion the above report tries to highlight the importance of UNIX or Linux
shell commands for the purpose of checking various system or even network specific
information. Despite these details also being available through GUI interfaces, shell scripts
are found to provide the complete details and aid in generating logs which automatically
show output of shell commands specified by the script and can be opened by admins any
time. The report is observed to deal with the script file mySysMonitor.sh which prints the
output of different system based and networking specific data in the mySysMonitor.log file.
In performing this, the report uses various UNIX based terminal commands and their
respective extensions for printing the desired results. The report then explains the use of these
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

13NETWORK AND SYSTEM MONITORING
commands. After this different screenshots are provided by the report showing contents of the
script and log files thus verifying the output.
commands. After this different screenshots are provided by the report showing contents of the
script and log files thus verifying the output.

14NETWORK AND SYSTEM MONITORING
Bibliography
Arabnejad, H., Jamshidi, P., Estrada, G., El Ioini, N. and Pahl, C., 2016, September. An auto-
scaling cloud controller using fuzzy q-learning-implementation in openstack. In European
Conference on Service-Oriented and Cloud Computing (pp. 152-167). Springer, Cham.
Fujikawa, K., Harai, H., Ohmori, M. and Ohta, M., 2016. Quickly converging renumbering in
network with hierarchical link-state routing protocol. IEICE TRANSACTIONS on
Information and Systems, 99(6), pp.1553-1562.
Ilsche, T., Schöne, R., Bielert, M., Gocht, A. and Hackenberg, D., 2017, September. lo2s—
multi-core system and application performance analysis for Linux. In 2017 IEEE
International Conference on Cluster Computing (CLUSTER) (pp. 801-804). IEEE.
Praptodiyono, S., Sofhan, R., Pramudyo, A.S., Firmansyah, T. and Osman, A., 2019.
Performance comparison of transmitting jumbo frame on Windows and Linux
System. Telkomnika, 17(1), pp.68-75.
Rad, B.B., Bhatti, H.J. and Ahmadi, M., 2017. An introduction to docker and analysis of its
performance. International Journal of Computer Science and Network Security
(IJCSNS), 17(3), p.228.
Silberschatz, A., Gagne, G. and Galvin, P.B., 2018. Operating system concepts. Wiley.
Taha, M., Garcia, L., Jimenez, J.M. and Lloret, J., 2017, June. SDN-based throughput
allocation in wireless networks for heterogeneous adaptive video streaming applications.
In 2017 13th International Wireless Communications and Mobile Computing Conference
(IWCMC) (pp. 963-968). IEEE.
Bibliography
Arabnejad, H., Jamshidi, P., Estrada, G., El Ioini, N. and Pahl, C., 2016, September. An auto-
scaling cloud controller using fuzzy q-learning-implementation in openstack. In European
Conference on Service-Oriented and Cloud Computing (pp. 152-167). Springer, Cham.
Fujikawa, K., Harai, H., Ohmori, M. and Ohta, M., 2016. Quickly converging renumbering in
network with hierarchical link-state routing protocol. IEICE TRANSACTIONS on
Information and Systems, 99(6), pp.1553-1562.
Ilsche, T., Schöne, R., Bielert, M., Gocht, A. and Hackenberg, D., 2017, September. lo2s—
multi-core system and application performance analysis for Linux. In 2017 IEEE
International Conference on Cluster Computing (CLUSTER) (pp. 801-804). IEEE.
Praptodiyono, S., Sofhan, R., Pramudyo, A.S., Firmansyah, T. and Osman, A., 2019.
Performance comparison of transmitting jumbo frame on Windows and Linux
System. Telkomnika, 17(1), pp.68-75.
Rad, B.B., Bhatti, H.J. and Ahmadi, M., 2017. An introduction to docker and analysis of its
performance. International Journal of Computer Science and Network Security
(IJCSNS), 17(3), p.228.
Silberschatz, A., Gagne, G. and Galvin, P.B., 2018. Operating system concepts. Wiley.
Taha, M., Garcia, L., Jimenez, J.M. and Lloret, J., 2017, June. SDN-based throughput
allocation in wireless networks for heterogeneous adaptive video streaming applications.
In 2017 13th International Wireless Communications and Mobile Computing Conference
(IWCMC) (pp. 963-968). IEEE.

15NETWORK AND SYSTEM MONITORING
Tan, J. and Zhong, B., 2015. Comparative study on educational effects between Linux and
Windows. International Journal of Continuing Engineering Education and Life Long
Learning, 25(3), pp.315-327.
Wu, M., Song, J., Lin, L.W.L., Aurelle, N., Liu, Y., Ding, B., Song, Z. and Moon, Y.B.,
2018. Establishment of intrusion detection testbed for CyberManufacturing
systems. Procedia Manufacturing, 26, pp.1053-1064.
Zahran, A.H., Quinlan, J.J., Ramakrishnan, K.K. and Sreenan, C.J., 2017, June. SAP: Stall-
aware pacing for improved DASH video experience in cellular networks. In Proceedings of
the 8th ACM on Multimedia Systems Conference (pp. 13-26). ACM.
Tan, J. and Zhong, B., 2015. Comparative study on educational effects between Linux and
Windows. International Journal of Continuing Engineering Education and Life Long
Learning, 25(3), pp.315-327.
Wu, M., Song, J., Lin, L.W.L., Aurelle, N., Liu, Y., Ding, B., Song, Z. and Moon, Y.B.,
2018. Establishment of intrusion detection testbed for CyberManufacturing
systems. Procedia Manufacturing, 26, pp.1053-1064.
Zahran, A.H., Quinlan, J.J., Ramakrishnan, K.K. and Sreenan, C.J., 2017, June. SAP: Stall-
aware pacing for improved DASH video experience in cellular networks. In Proceedings of
the 8th ACM on Multimedia Systems Conference (pp. 13-26). ACM.
1 out of 16
Related Documents

Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
© 2024 | Zucol Services PVT LTD | All rights reserved.