Question

We are going to configure our system to log messages associated with the mail system. View the letc/rsyslog.conf file to get

please post the answer for this question within half an hour and also provide the screenshots for every question including the commands also.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

SOLUTION

The following solutions have been implemented in Ubuntu Linux.

The “rsyslog.conf” file contains the configuration settings or rules pertaining to logging of system messages.

Create a new file “/etc/rsyslog.d/local2.conf” and append the configuration lines using the “vim” editor given below

vim /etc/rsyslog.d/local2.conf

The lines are

#

# LAB 4 Steps

#

local2.* /var/log/local2.log

These lines specify all messages associated with local2 facility regardless of priority should be entered in the corresponding log file.

The contents of the file can be viewed using the following command

cat /etc/rsyslog.d/local2.conf

Question C: Restart the logging service and send the following message

Issue the following command to restart the logging service

service rsyslog restart

The command given below can be used to send an informational message to the local2 facility.

logger -p local2.info “Testing message”

The “-p” stands for priority and then parameter given basically of the format “facility.level”.

The actual message is enclosed within “………..“ and given in the end.

Following the execution of the above command, the message will be entered in the /var/log/local2.log file which can be viewed using the following command.

cat /var/log/local2.log

Terminal Window Screenshot

Activities » Terminal - Aug 1 19:01 + root@ubuntu: - a a root@ubuntu:~# vim /etc/rsyslog.d/local2.conf root@ubuntu:~# cat /et

Question D: Screenshot of the “/var/log/local2.log” with the entry generated from the previous command execution.

Activities Text Editor - Aug 1 19:04 localz.log [Read-Only] /var/log arun: Testing message Open 1 Aug Save 1 19:00:02 ubuntu

Question E: Using “logger” send an informational message to the “authentication message log” with the sampe message and “tag” provided.

The following logger message can be used to implement the sending of informational message to the “/var/log/auth.log” file.

logger -p auth.info -t demo "Hello Sheridan Linux Users!"

The “-p” stands for priority and then parameter given basically of the format “facility.level”.

The “-t” stands for “tag”. By default, it takes the username.

The contents of the “auth.log” file after the execution of the above command can be viewed using the command

tail -5 /var/log/auth.log

It displays the last 5 lines(entries) in the corresponding file.

Terminal Window Screenshot

Activities Terminal Aug 1 19:19 SU: + root@ubuntu: root@ubuntu:-# logger -p auth.info -t demo Hello Sheridan Linux Users! ro

Question F: Screenshot of the “auth.log” with the entry generated from the previous command execution.

o . ++ Activities Text Editor Aug 1 19:21 auth.log [Read-Only] Open Save = /var/log securetty: No such file ог directory 244

NOTE:

The area highlighted in red is the entry generated corresponding to the “logger” command execution.

Hope this helps.

Add a comment
Know the answer?
Add Answer to:
please post the answer for this question within half an hour and also provide the screenshots...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT