logo

Linux System Change Logger Script

   

Added on  2023-05-30

12 Pages2750 Words201 Views
 | 
 | 
 | 
LINUX SYSTEM CHANGE LOGGER SCRIPT
Computer Systems and Networks
Name of the Student
Name of the University
Author’s Note
Linux System Change Logger Script_1

1
LINUX SYSTEM CHANGE LOGGER SCRIPT
Table of Contents
Introduction................................................................................................................................2
Specification...............................................................................................................................2
Design Consideration.................................................................................................................2
Extensive test result and exemplary log and screen output........................................................3
Conclusion..................................................................................................................................9
Bibliography.............................................................................................................................10
Linux System Change Logger Script_2

2
LINUX SYSTEM CHANGE LOGGER SCRIPT
Introduction
The report is prepared for creation of a change logger script created in ubuntu OS and
management of the regular activity of the user using the system. For the development of the
shell script the details of the system is extracted using different shell command and the output
is stored in an HTML file that would help the administrator to monitor the status of the
system. The pre-installed command line tools are used for the creation of the shell script and
the output is stored in a temporary log file for the management of the changes in the logs and
identify the changes in made in the current system.
Specification
The shell script is created using the nano editor and it is named as
“mySysMonitor.sh”, and proper permission is added to the shell script for running it.
Administrative permission is needed for running the shell script and thus “chmod +x
mySysMonitor.sh” command is used for providing appropriate permission and running the
shell script. “sudo ./mySysMonitor.sh”, command is used for running the shell script as root
user and generate the output in a HTML file.
Design Consideration
The shell script is designed using separate command for getting each of the
information necessary for the development of the change logger script. The main function of
the script is to monitor the current computer system and the activity of the user for creating a
log with the key information. The script is named as “mySysMonitor.sh” which automatically
and regularly writes the information in log file named “mySysMonitor.log”. The output of the
shell script is stored in the html file and it uses the “mySysMonitor.log” as a temporary file
for storing the result of the command executed in the shell script. Since the contents of the
file is copied in a temporary file and “tail -f” command is used for comparing the changes in
Linux System Change Logger Script_3

3
LINUX SYSTEM CHANGE LOGGER SCRIPT
the log file and identification of the changes made in the current system. For constructing the
shell script the the following commands are used such as:
printf "At %s: \n" "$(date)" // displays the data and time of the system
ps // displays the current processes running on the system
who // finds the users logged into the system
lsusb // finds the usb devices plugged in with the system
df -h /boot|awk '{print $5 " "$6}' // used for displaying the overall disk usage
df -h /home|sed -n '2p' |awk '{print $5 " "$6}' // lists the home directory of the user
df -h // lists the other key directories of the system
ip link show // displays the network interface used for connecting with the internet
ping -c 1 google.com &> /dev/null && echo -e "Internet: Connected" || echo -e
"Internet: Disconnected"; // used for finding the connection is active or disconnected
(uptime | awk '{print $3,$4}' | cut -f1 -d,) // used for finding the system uptime
Extensive test result and exemplary log and screen output
The shell script prepared for management of the change log is given below:
#! /bin/bash
#Author : - Student
#Date : - 29 November, 2018
#Check if the script is executed as ROOT. The script must be run from a root user for
maintaining proper directory structure:
if [ $EUID != 0 ]
Linux System Change Logger Script_4

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Linux System Change Logger Script
|26
|4743
|96

Computer Systems and Networks - Shell Script for Monitoring System Changes
|15
|4230
|150

Network and System Monitoring Report 2022
|16
|2229
|46

Network Administration and Monitoring
|13
|2170
|493

IMAT5122 – Computer Systems and Networks Case Study 2022
|5
|902
|18

User Instructions for Execution of Change Logger Script for Linux
|10
|1401
|423