Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install Logwatch in Ubuntu 15.04system

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to install Logwatch in the Ubuntu 15.04system", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to install Logwatch in the Ubuntu 15.04system" this article.

Pre-installation settings

We will use the Ubuntu version 15.04 operating system to deploy Logwatch, so before installing Logwatch, make sure that the mail service settings on the system are available properly. Because it will email the generated report to the administrator in the form of a daily newspaper every day. Your system's source library should also be made available so that Logwatch can be installed from a generic source library.

Then open the terminal of your ubuntu system, log in with your root account, and update your system software package before entering the Logwatch installation operation.

Root@ubuntu-15:~# apt-get update install Logwatch

As long as your system has been updated and meets the prerequisites mentioned above, you can type the following command on your machine to install Logwatch.

Root@ubuntu-15:~# apt-get install logwatch

During the installation process, once you press the "Y" key at the prompt to agree to make changes to the system, Logwatch will begin to install some additional required packages.

During the installation process, you will be prompted to configure Postfix settings based on the mail server settings on your machine. In this tutorial, we use the easiest "Local only only" option. Depending on your infrastructure, you can also select other options, and then click OK to continue.

Potfix Configurations

You then have to choose the mail server name, which will also be used by other programs, so it should be a fully qualified domain name / full domain name (FQDN).

Postfix Setup

Once you press "OK" at the bottom of the postfix configuration prompt, the installation process installs with the default configuration of Postfix and completes the entire installation of Logwatch.

Logwatch Completion

You can check the Logwatch status by issuing the following command from the terminal, which should normally be active.

Root@ubuntu-15:~# service postfix status

Postfix Status

To confirm the installation information for Logwatch in the default configuration, simply issue the "logwatch" command as shown below.

Root@ubuntu-15:~# logwatch

The output of the above execution command is the report display format compiled under the terminal.

Logwatch Report

Configure Logwatch

After successfully installing Logwatch, we need to make some changes in its configuration file, which is located in the path shown below. So, let's open it with a text editor and make some changes as needed.

Root@ubuntu-15:~# vim / usr/share/logwatch/default.conf/logwatch.conf

Output / formatting options

By default, Logwatch prints unencoded text to standard output. To change to mail as the default, you need to set "Output = mail", to change to save as a file, you need to set "Output = file". So you can set its default configuration according to your requirements.

Output = stdout

If you are using an Internet email configuration, to use the Html format as the default out format, you need to modify it to look like the following line.

Format = text

Now add the default email report recipient address, which can be a local account or a complete email address, and you can write anything you need on this line.

MailTo = root#MailTo = user@test.com

The default sender can be a local account or another name you need to use.

# complete email address.MailFrom = Logwatch

Save changes to this configuration file, and leave it as default for other parameters without any changes.

Scheduling task configuration

Now edit the "00logwatch" file in the "daily crons" directory to configure the email address that needs to be sent for reports generated from logwatch.

Root@ubuntu-15:~# vim / etc/cron.daily/00logwatch

Here you need to use "--mailto user@test.com" to replace "--output mail", and then save the file.

Logwatch Cronjob

Generate a report

Now we execute the "logwatch" command in the terminal to generate the test report, and the resulting results will be displayed in text format in the terminal.

Root@ubuntu-15:~#logwatch

The beginning of the generated report shows the time and date of execution. It contains different parts, each of which begins with the beginning identity and ends with the end identity, with complete information about that part displayed in the middle.

What is shown here is what it looks like, starting with a section that shows all the packages installed on the system, as follows:

Dpkg status

The next section shows log information about the current system login session, rsyslogs, and current and recent SSH sessions.

Logwatch report

The Logwatch report * shows the security sudo log and root disk usage, as shown below:

Logwatch end report

You can also open the following file to view the generated logwatch report email.

Root@ubuntu-15:~# vim / var/mail/root

You will see all generated messages sent to your configured users and their delivery status.

More details

Logwatch is a great tool and you can learn a lot, so if you are interested in its log monitoring capabilities, you can also get more help with the short commands shown below.

Root@ubuntu-15:~# man logwatch

The above command contains all the user manuals about logwatch, so read it carefully and simply type "Q" to exit the manual.

You can get more details about the use of the logwatch command using the help command shown below.

Root@ubuntu-15:~# logwatch-help above are all the contents of the article "how to install Logwatch in Ubuntu 15.04system". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report