Linux Logs, programming homework help

Please add and complete the assignment.  I received a 60/100 for this submission.  I took a photo in class of what the solution should be.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

*Below is the comment from the professor.

All of the log descriptions and sample lines were OK, but you only attempted to provide regular expressions for 3 of those and no scripts were provided for any of those.  The regular expressions were all incorrect and not creditable. ITEC 325
Spring 2013
Assignment 3
Working individually you will choose five log files.
For each of the logs you should perform the following tasks:
 Describe the log
 Create a script that may be useful in managing the log
 Illustrate why the script would be useful
 Create one regular expression that may be useful in analyzing the log
 Describe the rules that dictate the pattern of the regular expression
 Illustrate why the regular expression would be useful.
 (The regular expression should be part of the script)
When describing the log please provide 4 – 5 sample lines and discuss them briefly.
The five logs should be divided as follows:
 Three logs generated by the system (for example: daemon, kern, syslog)
 Two logs generated by installed applications (for example: mysql, apache
BASH SCRIPT ASIGNMENT
Identify 5 Log Files
1. sysLog.log
Contains information logged by the various background daemons that runs on the
system. Syslog file displays the running system information to help users detect errors
and troubleshoot. They provide a mechanism for a user to trace and identify any flows
within a given system. They also enable one to monitor events, activities or actions
leading to a certain flow.
Sample Log entries up to 4 Lines
The entries below show the types of processors supported by the kernel system as
logged on a specific date
Jun 28 19:16:07 ubuntu kernel: [
0.000000] KERNEL supported cpus:
Jun 28 19:16:07 ubuntu kernel: [
0.000000] Intel GenuineIntel
Jun 28 19:16:07 ubuntu kernel: [
0.000000] AMD AuthenticAMD
Jun 28 19:16:07 ubuntu kernel: [
0.000000] Centaur CentaurHauls
A regex expression that can be useful in managing the Log
The Regex expression below returns the Loge entries for a given date. It lops through
all the entries comparing the date with the one requested by a user.
[[ $line =~ .$string.* ]]
This can be useful in case an administrator wants to trace activities from a given date.
2. dpkg Log
This log file contains entries that are logged when a package is installed or removed
using dpkg command. It records all the apt activities, such as installs or upgrades, for
the various package managers also you can view synaptic logs through its Graphical
user interface.
Sample lines from the Log
2014-04-17 01:21:23 status unpacked base-files:amd64 7.2ubuntu5
2014-04-17 01:21:23 status half-configured base-files:amd64 7.2ubuntu5
2014-04-17 01:21:24 status installed base-files:amd64 7.2ubuntu5
2014-04-17 01:21:24 startup archives install
A regex ecpression to manage the log:
Illegal installations or unexpected upgrades tend to create unexpected problems. When
softwares update, users tend to realize some abnormalities. Troubleshooting to find
out when an upgrade was done can help identifies causes of malfunctions.
The regex code line below identifies when upgrades were made by displaying all lines
with the word upgrade.
[[ $line =~ .*$string.* ]]
It takes two arguments; a line from a file and a string specifying an upgrade.
3. kernel.log
The file provides a detailed log of messages from the Linux kernel. It helps in
troubleshooting the built in kernel especially newer custom versions.
Sample Code
Jun 28 19:16:07 ubuntu kernel: [
0.000000] BIOS-e820: [mem
0x00000000000e0000-0x00000000000fffff] reserved
Jun 28 19:16:07 ubuntu kernel: [
0.000000] BIOS-e820: [mem
0x0000000000100000-0x00000000a56affff] usable
Jun 28 19:16:07 ubuntu kernel: [
0.000000] BIOS-e820: [mem
0x00000000a56b0000-0x00000000a5eaffff] reserved
Jun 28 19:16:07 ubuntu kernel: [
0.000000] BIOS-e820: [mem
0x00000000a5eb0000-0x00000000aaabefff] usable
Kernel Log file gives detailed messages from the linux kernel.
4. Auth.Log:
This file keeps record of events and actions during authentication of users within a
Linux system. All authentication related activities, sessions user management
activities are logged on to this file. It also helps identify unauthorized access
attempts and successful access attempts to a system.
Sample Lines
Jun 28 19:16:17 ubuntu sudo: pam_unix(sudo:session): session opened for user
ubuntu by (uid=0)
Jun 28 19:16:17 ubuntu sudo: pam_unix(sudo:session): session closed for user
Ubuntu
Jun 28 19:16:17 ubuntu sudo: ubuntu : TTY=unknown ; PWD=/ ; USER=ubuntu
; COMMAND=/usr/bin/gsettings get org.gnome.desktop.media-handling
automount
5. Xorg Log
Xorg is basically the X window system used in Linux. It’s the base of the graphical
environment for your computer. The xorg log contains details of applications making
use of the graphical environment. This Log file can be used to track which processes
are slowing the computer.
Sample Log Lines
[
37.589]
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
[
37.589] Markers: (–) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
The log entries above basically give directions to a user to upgrade to a later versions.
This log file tends to row so easily and sometimes can go to several megabytes. To
ensure that the logging process all together does not slow the computer, the log file
can be resized using the regex code:
$line=”${line/*/”}”
The line replaces all other lines after the ten thousandth line with empty lines thus
making the log file small.
Asusco Аавьс Aance Аав аа
17 22:43 Poute la peredes
392261
Manabha tered
17 relor- 00:
09:04:
03:00:00-01:08:00 -2.6.213.24
23317 strated pa to root 15.59.255.2 pers De
Sales and for roes 92.203.189.25 pct 2156 sh2
23 tot dy 1.255.100.15 port30562
2. Gied peased for moderateranerom 91.205.189.15 per 10054
123071 mana pe tot visdro from 1.205.15-19 port 2017
on rasked and for tout
t.205.109.25 pont 29467 ha

Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER