Hello and welcome to log mentoring lesson another and most important way of system administration is
law monitors.
Think of a law monitor in a way as if you have if you have your personal physician or a doctor.
Every time you go to him he or she has a chart on you which record or your medical history which tells
the doctor what are the problems you had in the past whether you had any surgery whether you are allergic
to any medicine.
So that is the way doctors keep logs on your physical health just like that.
Systems also have to keep logs and generate logs and record everything that goes on with the system.
So in our log directory right here in our living system a primary log directory is our and slash log.
All the logs that are generated in Linux machines are mainly in our law directory unless specified or
changed in the configuration file on an application to change the log location.
A few of the logs that we will cover in this lesson are one number one is Boot Boot is the log when
your system boots up reboots and generates this log and records everything that goes on to your system
how it cleans up the memory.
What are the processes storing up if it hasn't.
If it if it is having any issues it will log everything in there.
Then you have cronie D which is in your worship of a.p it has its own log cron mail all secure logs.
The next one we have the messages long messages is one of the important logs that every system I'm sure
uses to monitor system activities everything that is as a hardware wise application wise or process
wise.
Anything that has to do with the systems or even application wise it goes into war log messages.
Then at the last one we have a GDP which is also an Apache application log.
So without further ado will log into my Linux machine log it as myself.
I already have an IP that as specified.
So once I log in I'll go into our slash log directory when I am in slash log directory.
I could run this by an L command or simply run parallel.
And you all the locks and once again when I run that it has so many logs so many files so many directories
that I cannot view them all in one page all the movers tell all of it to morrow and you will see l l
will list all the files by alphabetical orders.
So the first one is audit audit is of the files or directories that has all the audit permission.
Then we have boot up log.
Let's look at boot log.
You do more on that log.
I get in message say permission denied.
Why do I get that message.
Because the book that log is owned by root and the group who owns that file is altered.
So at my.
My non-root.
OK so if I'm not rude.
Do I have the permission to read the file.
And as others I should have read permission right here.
Right.
Last rebirths or if I'm part of the group I should be.
I should have access here.
So neither group nor regular ordinary users has access read a file.
So all in all it hasn't.
So we will become group
go back to our blog and we'll do that blog.
When I hit enter.
We will see on the left side it is coming up with OK messages while the system is booting up every time
there is an issue with the system booting up.
It will come up with a message saying fault or error or alert.
So you'll see it is starting.
All the services one by one.
It is storing all the processes.
Welcome to sento Ascelin except when it's going through each step of this start up and when it starts
up completely it stops the log.
When you reboot your system this file that you are less wise elbowed a lot this fall gets overwritten.
So if I reboot my machine right now it will generate a new file and it will rewrite this log.
OK so next one we have is croney Kirani as replacement of a.p service.
Any type of changes that you make on that cronie service.
It actually generates the log in and it actually locks that information into the locks.
Next one we have in the list is Crohn.
If you look at it on the left hand side I'm just going by what I have listed there are many other files
and if you have time and if you are interested in learning all these different logs then please be my
guest.
Try out every command.
Also try out every part and see what they are used for the next one I want to cover is the Crohn which
is right here.
You Whenever you schedule a job or a process through a cron tab entry it generates some kind of activity
and activity or that record is log into this file.
So you could do Crohn and you will see all the information about the cron.
And by the way when ever you open up a log file the first is the month.
Second Date Time.
The name of your host name the daemon which is cron D and process ID associated with that daemon.
The user who is running that and the command or entry that has been associated with their crop.
Moving on we have the next one we have quickly.
There is a command called the message you when you run this command.
This one also gives you information about the hardware.
If you do not want to run this command you could simply do a cap on the messages as well.
Which will give you the exact same information.
The next one we have as mail log mail log has all the information about your sendmail daemon which means
every time you send an email out or every time the email comes and all that activity is being recorded
in this lock.
Now whenever you are troubleshooting issues with sendmail service this is one of the logs you will have
to look into to see why you are where your server is not able to send emails.
Moving on then we have a secure log right here.
Now secure logs is the log that actually records all your logging in logging activity.
So when you do more secure you will see all the users that have been logged in.
If they have failed logging in or if they from which machine they are logging in all the information
about the users.
So I am what I'm going to do.
I'm going to do taled minus F now minus f is the option that will keep on sniffing the lawn and every
time a new record is updated to the log that tail minus F will get their newest log at the bottom.
So if I do till mine is secure and I'll keep running this command.
This command is running now I'm going to open up another session another position.
I have already saved and if I log in as myself and I type in wrong password let's say as soon as I type
wrong password you see in the background.
It says right here failed a password for I saw and I'm trying to log in from this machine when I $161
8.
If I log back in with the correct password then I will get that additional record for my session sync
session open for user of Sol.
So this is about the secure secure log file and the next one is the one of the most important log file
that you should spend your time in messages.
Every time there is an issue with you machine the first thing an administrator does.
They log into your machine and they will trace the logs in messages.
So you go into our law and then you do more of your messages.
Now this file has again once again.
This file has all the hardware information all the software information all the application in all the
processes information everything is being logged into this log.
So if I wanted to see how many lines this log file has I could do cat messages and do w c minus and
up see seven thousand one or three lines if I wanted to see if there are any error messages in this
file.
So I'll do grep minus Hi I is to ignore uppercase lowercase from message just file and you'll see it
actually grep every line inside of this log file that has a message called error.
So this way you can go and see what's going on with your system.
What happened why it failed or what time it failed.
So anyway let's wrap up the lesson and again spend some time in this war log messages.
Go over all these log files pacifically the ones I have in this lesson and see what type of different
logs there are.
View them group for certain errors and get yourself familiar with them.