How to install Logwatch in Ubuntu 15.04 system

Source: Internet
Author: User
Tags time and date disk usage fully qualified domain name

Hello everyone, today we will talk about how to install the Logwatch software on the Ubuntu 15.04 operating system, which can also be installed on a variety of Linux and Unix-like systems. Logwatch is a customizable log analysis and log monitoring report generation system that generates detailed reports that you want to follow based on log files for a period of time. It is easy to install, easy to configure, can be reviewed and other features, but also the security of the data provided there are some safeguards. Logwatch scans the log files for important operating system components like SSH, Web services, and so on, and then generates a summary report of valuable items that the user cares about.

Pre-installation settings

We will use the Ubuntu 15.04 version of the operating system to deploy Logwatch, so before installing Logwatch, make sure that the mail Service settings on the system are normally available. Because it sends the generated report to the Administrator daily through the form of a daily message. Your system's Source library should also be set up to be available so that Logwatch can be installed from the common Source Library.

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

[Email protected]:~# apt-get Update

Installing Logwatch

As long as your system has been updated and has met the prerequisites described earlier, you can install Logwatch by entering the following command on your machine.

[Email protected]:~# apt-get Install Logwatch

As soon as you press the "Y" key to agree to the system changes during the installation process, Logwatch will start installing some additional required packages.

The configuration interface for the Postfix setting is prompted during the installation process based on the mail server settings on your machine. In this tutorial we use the easiest "local only" option. Depending on your infrastructure, you can choose a different option, and then click OK to continue.

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

Once you press "OK" at the bottom of the Postfix configuration prompt, the installation process will be installed with the postfix default configuration and complete the Logwatch installation.

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

[Email protected]:~# service postfix status

To confirm the installation information for Logwatch under the default configuration, you can simply issue the "Logwatch" command as shown below.

[Email protected]:~# logwatch

The output of the above execution command is the presentation format of the report produced under the terminal.

Configure Logwatch

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

[Email protected]:~# vim/usr/share/logwatch/default.conf/logwatch.conf

Output/formatting options

By default, Logwatch prints to standard output in non-encoded text. To change to mail as the default, you need to set "output = Mail" 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 e-mail configuration, use the Html format as the default format and you need to modify it to look like the following line.

Format = text

Now add the default mail report recipient address, either a local account or a full email address, all you need to write on this line

MailTo = root

#MailTo = [email protected]

The default mail sender can be a local account or a different name that you need to use.

# Complete Email address.

Mailfrom = Logwatch

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

Scheduling Task Configuration

Now edit the "00logwatch" file in the "Daily Crons" directory to configure the e-mail address to be sent from the Logwatch report generated.

[Email protected]:~# vim/etc/cron.daily/00logwatch

Here you need to function "--mailto [email protected]" to replace "--output Mail" and then save the file.

Generate reports

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

[Email protected]:~ #logwatch

The resulting report starts with the time and date of execution. It contains different sections, each beginning with the start of the identity and ending with an end-of-identity, showing the complete information for that part.

Here is the beginning of the show, which starts with a section showing all the packages installed on the system, as follows:

The following section shows the log information about the current system logon session, Rsyslogs, and current and recent SSH session information.

Logwatch the report finally shows the sudo logs for security and root disk usage.

You can also open the following file to view the generated Logwatch report e-mail.

[Email protected]:~# vim/var/mail/root

You will see all generated messages sent to the user you configured and their mail submission status.

More details

Logwatch is a very good tool, you can learn a lot, so if you are interested in its log monitoring function, but also by the following short command to get more help.

[Email protected]:~# man Logwatch

The above command contains all the user manuals about Logwatch, so read on carefully and simply enter "Q" to exit the manual.

For the use of the Logwatch command, you can use the Help command shown below to get more details.

[Email protected]:~# logwatch--help

Conclusion

At the end of the tutorial, you also learned how to setup, configure, and Logwatch on Ubuntu 15.04. Now you can customize the monitoring of your system logs, whether it's monitoring the operation of all services or sending a report to a specific service at a specified time. So, start using the tool!

free pick up brother even it education original Cloud Computing Training video/Detailed Linux tutorials, details of the website customer service: http://www.lampbrother.net/linux/ or hooking up with q2430675018~.

Welcome to the Linux Communication Group 478068715


How to install Logwatch in Ubuntu 15.04 system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.