IMAT5122: Analysis and Design of a Linux System Change Logger Script

Verified

Added on  2022/10/18

|5
|902
|18
Practical Assignment
AI Summary
This assignment provides a detailed analysis of a Linux system change logger script designed for monitoring system health. The script focuses on tracking memory, processor, and other resource usage, user details, file usage, processes, network interfaces, and connected devices. The document explains the design considerations, including the use of commands like `lsusb`, `ps`, and `awk`, to gather and process system information. It also covers the execution of the script using `sudo` and the importance of providing execute permissions. The assignment includes test results with exemplary log and screen outputs, and concludes with a reflection on the importance of resource management and performance monitoring in a UNIX environment. The script aims to provide critical performance metrics for fine-tuning system performance and diagnosing bottlenecks, saving administrators time in troubleshooting.
Document Page
Running head: IMAT5122 – COMPUTER SYSTEMS AND NETWORKS
IMAT5122 – Computer Systems and Networks
Name of the Student
Name of the University
Authors note
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
1IMAT5122 – COMPUTER SYSTEMS AND NETWORKS
Specification and use of Linux System Change Logger Script
As there are numerous commands are used inside the shell script and some of those of
requires elevated privileges than a simple user (i.e. requires root or super user privileges). As
in most of the cases the default root account is locked under some of the Linux distribution.
Therefore, it is suggested to use the ‘sudo’ command in order to execute the script as super
user in the Linux environment. Through the use of the sudo, the kernel of the system allows a
simple user to execute a script or command as a super user.
As by default the Linux does not provide the execute permission for any file in its file
system or a recently created file. Therefore, in order to execute the file it is suggested that,
use of the chmod command in order to provide execute command. Therefore, in order to get
the permission, the following command needs to be executed.
chmod +x mySysMonitor.sh
In the next step, the script can be executed using the following command;
sudo ./ mySysMonitor.sh
Design consideration for the Script
As the script will be responsible for the monitoring the health of the linux based
computers thus the main objective will be to find out the memory, processor and other
resource usage. In addition to that the detail of the users, their home directories, usage of
files, different processes, statics of the usage and users, network interfaces and status of those
interfaces, plugged in devices to the system and finally list all the current processes. System
resource utilization is dependent on the administrator of the system as well as administrator’s
expectation and finally specifications. Only way to determine in case of any unusual
Document Page
2IMAT5122 – COMPUTER SYSTEMS AND NETWORKS
performance issues of the servers it is important to know the expected behavior or
performance from the system.
Following is the list of the used commands;
In order to list all the plugged in USB devices: lsusb
In order to leverage most of the features of this command the targeted Linux kernel
should supports /proc/bus/usb interface
In order to list Current processes: ps
“ps” is an linux utility tool which is helpful in displaying the information about the
system processes on an computer that is running an Linux operating system. The “ps” is the
abbreviation of “Process Status”. The “ps” command displays all the running processes at a
given point of time along with their PIDs on the standard output (on the screen) and with
some extra information if the user or scrisspt explicitly uses other available options. This
command collects process related information from /proc file-system. This file in the Linux
system consist of the virtual files and for this reason it is referred as a virtual file system.
awk tool to collect specific columns from the details
awk is another utility tool in Linux language used for manipulating collected data
from the system as well as generate reports. In case of using awk it does not require any
compiling and thus allows user of the linux system in order to use the variables, string
manipulation functions, numeric functions as well as logical operations.
Through the use of this tool a system administrator or programmer can write small but
effective scripts. This scripts can be of the form of statements which can be used in order to
define and extract text patterns that needs to be searched from a file or out of another
Document Page
3IMAT5122 – COMPUTER SYSTEMS AND NETWORKS
command in every line of a document. Furthermore the action which is to be carried out can
also be carried out whenever a match is found within a line.
This utility is often used for searching, matching and processing patterns. This tool is
also capable of searching one or more files in order to find out if they contain lines that
matches.
Test results with exemplary log and screen outputs
Conclusion / Reflection
While writing the script for the system health monitoring, I found that some time it is
important to manage the available resources in an optimized manner so that no unnecessary
processes in the network should not exhaust the available resources such as memory and cpu
processing cycles. In case of UNIX operating system the performance monitoring ensures
the performance and availability of the resources for the critical processes inside the OS
environment. With the help of the different UNIX monitoring commands the script is capable
of providing plenty of critical performance metrics that can help in fine tuning performance
as well as OS activities. Furthermore, the system administrators can drill-down the different
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
4IMAT5122 – COMPUTER SYSTEMS AND NETWORKS
performance metrics in order to identify the cause at any scenario of degraded performance
bottlenecks. In the manual way, this monitoring of the diagnosis may take lot of time in
order to diagnose troubleshoot.
chevron_up_icon
1 out of 5
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]