Logwatch, as its name implies, is a software dedicated to monitoring Linuxlog files (log files. After installation, you can send the host log analysis file to the specified mailbox every day. Why? This saves the time and energy for administrators to manually view logs. And every day (or even more frequently
Logwatch, as its name implies, is a software that monitors Linu
Original: HTTP://SEANLOOK.COM/2014/08/23/LINUX-LOGWATCH-USAGE/1. IntroducedWhen maintaining a Linux server, it is often necessary to review the logs of various services in the system to check the server's operational status. such as login history, mail, software installation and other logs. It is very inconvenient for the system administrator to check each one, a
1. Introduce
When maintaining a Linux server, it is often necessary to look at the logs of the various services in the system to check the running state of the server. such as login history, mail, software installation and other logs. It's very inconvenient for a system administrator to check it out, and most of the time it's a passive check that only when you find the system running an exception can you think of the log to get information about the
Use logwatch to monitor log files in Linux
Linux operating systems and many applications create special files to record their running events. These files are often called "logs ". These system logs or specific application log files are essential tools for understanding the behavior of operating systems or third-party applications or troubleshooting. However, log
Use logwatch to monitor log files in Linux
Linux operating systems and many applications create special files to record their running events. These files are often called "logs ". These system logs or specific application log files are essential tools for understanding the behavior of operating systems or third-party applications or troubleshooting. However, log
Logwatch, as its name implies, is a software that monitors Linux log Files. After installation, you can send the host log analysis file to the specified mailbox every day. Why? This saves the time and energy for administrators to manually view logs. And can receive logs accurately every day (or even more frequently. In this way, you can understand the security of your servers.
The following installation met
"description"Logwatch is a log analysis tool developed using PerlLogwatch can analyze the log files of Linux and automatically send mail to relevant handlers to customize the requirementsThe mail function of the Logwatch is sent by mail server that comes with the host system, such as Sendmail,postfix,qmail, etc.ConfigurationBecause the system already supports the
"00 logwatch" under the daily crons directory"
Root @ ubuntu-15 :~ # Vim/etc/cron. daily/00 logwatch
Here you need to use the "-- mailto" user@test.com to replace the output mailbox and save the file. (For example)
Logwatch report
Enter the "logwatch" command in the terminal to obtain the result.
Root @ ubuntu-15 :~
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 t
Install Logwatch on Centos7 and use the msmtp mail client to send server monitoring and analysis logs
###########################
# DATE 2016-07-29 #
# Authur by Denilas Yeung #
###########################
1. Install msmtp
Download msmtp: http://jaist.dl.sourceforge.net/project/msmtp/msmtp/1.6.5/msmtp-1.6.5.tar.xz
Because the file format is xz, the decompression method is:
# Xz-d msmtp-1.6.5.tar.xz
# Tar xvf msmtp-1.6.5.tar
# Cd msmtp-1.6.5
#./Configu
############################DATE 2016-07-29 ##Authur by Denilas Yeung ############################First, install the MSMTPDownload MSMTP:HTTP://JAIST.DL.SOURCEFORGE.NET/PROJECT/MSMTP/MSMTP/1.6.5/MSMTP-1.6.5.TAR.XZBecause the file format is XZ, the decompression method is:#xz-D Msmtp-1.6.5.tar.xz#tar XVF Msmtp-1.6.5.tar#cd msmtp-1.6.5#./configure--PREFIX=/USER/LOCAL/MSMTP#make#make Install#/usr/local/msmtp/bin/msmtp-p #确认配置文件存放路径, Centos7 configuration file created MSMTPRC file under/usr/local/et
@ bj ~] # Mail Mail version 8.1 6/6/93. Type? For help. "/var/spool/mail/root": 5 messages 5 new> N 1 logwatch@localhost.l Thu Feb 2119:21 43/1563 "Logwatch for node1 (Linux) "N 2logwatch@localhost.l Fri Feb 2213:08 93/2804" Logwatch for node1 (Linux) "N 3logwatch@bj.siqian
error records33 system time # dateCheck whether the system time is correct34. Number of opened files # lsof | wc-lCheck whether there are too many open files35 logs # logwatch-print configuration/etc/log. d/logwatch. conf: Set Mailto to your own email address and start the mail service (sendmail or postfix) so that you can receive the log report every day.By default, l
be run. Check whether the number exceeds 4 times the system logic CPU.
28 process # top-id 1
Check for abnormal Processes
29 check whether the network status can be properly connected, such as DNS and gateway.
30 users # who | wc-l
Run the following command to check whether there are too many login users (for example, more than 50): # uptime
31 system logs # cat/var/log/rflogview/* errors
You can also search for some exception keywords to check whether there are any error records, for exam
many login users (for example, more than 50): # uptime31 system logs # cat/var/log/rflogview/* errorsYou can also search for some exception keywords to check whether there are any error records, for example:# Grep-I error/var/log/messages# Grep-I fail/var/log/messages# Egrep-I 'error | Warn'/var/log/messages view system exceptions32 core logs # dmesgCheck for abnormal error records34. Number of opened files # lsof | wc-lCheck whether there are too many open files35 logs #
) [28389]: ses sion opened for user tom by (uid = 2009)
Sep 19 08:41:28 orange sshd (pam_unix) [28389]: ses sion opened for user tom by (uid = 2009)
Sep 19 08:41:28 orange September 19 08:41:28 su '(pam_unix) [28425]: session opened for user root by tom (uid = 2009)
Most of these logs are of little use, but they may be useful in tracking a specific problem or security vulnerability. So how can we effectively analyze and monitor it and play its real role? We recommend two commonly used log analys
often modify log files to hide traces during attacks. Therefore, we need to restrict access to/var/log files and prohibit users with General permissions from viewing log files.
You must also use the log server. It is a good idea to save a copy of the client's log information. You can create a server to store log files and check logs to find problems. Modify the/etc/sysconfig/syslog file to accept remote log records.
/Etc/sysconfig/syslog
SYSLOGD_OPTIONS = "-m r 0"
You should also set remote log
08: 40: 11 apple net-snmp [657]: Received SNMP packet (s) from udp: 159.226.2.144: 42988Jan 9 08: 41: 15 orangesshd (pam_unix) [28389]: ses-sion opened for user tom by (uid = 2011) Jan 9 08:41:28 orange sshd (pam_unix) [28389]: ses-sion opened for user tom by (uid = 2011) jan 9 08:41:28 orange January 9 08:41:28 su '(pam_unix) [28425]: session opened for user root by tom (uid = 2011)
Most of these logs are of little use, but they may be useful in tracking a specific problem or security vulnerab
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.