Rsyslog + loganalyzer + evtsys build a centralized monitoring system

Source: Internet
Author: User
Tags rsyslog

1. Server Installation

YUM source is created. If yes, it can be omitted.

 
 
  1. # cat >> /etc/yum.repos.d/sohu.repo <<EOF 
  2. [sohu] 
  3. name=sohu's mirrors 
  4. baseurl=http://mirrors.sohu.com/centos/5/os/x86_64/ 
  5. enabled=1 
  6. gpgcheck=0 
  7. EOF 

Install the LAMP environment and rsyslog. If LAMP is available, you only need to install rsyslog-mysql.

 
 
  1. yum install rsyslog rsyslog-mysql mysql mysql-devel mysql-server php php-mysql php-pdo php-common php-gd httpd 

Import rsyslog Database

 
 
  1. mysql -u root -p < $(rpm -ql rsyslog-mysql | grep sql$) 

Create a database user

 
 
  1. mysql -u root -p 
  2. mysql> grant all privileges on Syslog.* to logger@localhost identified by 'logger'; 
  3. mysql> flush privileges; 
  4. mysql> exit; 

Modify the rsyslog configuration file

 
 
  1. # Vi/etc/rsyslog. conf // modify it.
  2. # Use traditional timestamp format
  3. $ Actionfiledefatemplate template RSYSLOG_TraditionalFileFormat
  4.  
  5. # Provides kernel logging support (previously done by rklogd)
  6. # Provides support for local system logging (e.g. via logger command)
  7. $ ModLoad immark
  8. $ ModLoad imuxsock
  9. $ ModLoad imklog
  10.  
  11. $ ModLoad ommysql
  12. *. *: Ommysql: 127.0.0.1, Syslog, logger, logger
  13.  
  14. $ ModLoad imudp. so
  15. $ UDPServerRun 514
  16.  
  17. # Log all kernel messages to the console.
  18. # Logging much else clutters up the screen.
  19. # Kern. */dev/console
  20. # Log anything (could t mail) of level info or higher.
  21. # Don't log private authentication messages!
  22. *. Info; mail. none; authpriv. none; cron. none/var/log/messages
  23. # The authpriv file has restricted access.
  24. Authpriv. */var/log/secure
  25. # Log all the mail messages in one place.
  26. Mail. *-/var/log/maillog
  27. # Log cron stuff
  28. Cron. */var/log/cron
  29.  
  30. # Everybody gets emergency messages
  31. *. Emerg *
  32. # Save news errors of level crit and higher in a special file.
  33. Uucp, news. crit/var/log/spooler
  34.  
  35. # Save boot messages also to boot. log
  36. Local7. */var/log/boot. log

The red part is added. For other comparisons, some are skipped. If not, add it.

Install LogAnalyzer

 
 
  1. # wget http://download.adiscon.com/loganalyzer/loganalyzer-3.6.3.tar.gz 
  2. # tar xf loganalyzer-3.6.3.tar.gz 
  3. # mkdir /var/www/html/loganalyzer 
  4. # mv loganalyzer-3.6.3/src/* /var/www/html/loganalyze 
  5. # touch /var/www/html/loganalyzer/config.php 
  6. # chmod 666 /var/www/html/loganalyzer/config.php 

Install it in a browser.

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/1T32553J-0.jpg "border =" 0 "alt =" "/>

 

 

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/1T32534W-1.jpg "border =" 0 "alt =" "/>

 

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/1T32514Q-2.jpg "border =" 0 "alt =" "/>

 

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/1T32564Z-3.jpg "border =" 0 "alt =" "/>

 

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/1T3254004-4.jpg "border =" 0 "alt =" "/>

The above completes the installation of loganalyzer, login to view

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/1T3253510-5.jpg "border =" 0 "alt =" "/>

Ii. Windows Client installation

Download evtsys http://code.google.com/p/eventlog-to-syslog/

 
 
  1. Decompress the package to C: \ Windows \ System32
  2. Evtsys-I-s 10-h log-server-ip-p 514
  3. Net start evtsys

During installation, an error is reported, which is caused by the configuration file. You can ignore this issue as long as the installation is successful. Detailed parameters are attached below

 
 
  1. Version: 4.4 (32-bit) 
  2. Usage: evtsys.exe -i|-u|-d [-h host] [-b host] [-f facility] [-p port] 
  3.        [-s minutes] [-l level] [-n] 
  4.   -i           Install service 
  5.   -u           Uninstall service 
  6.   -d           Debug: run as console program 
  7.   -h host      Name of log host 
  8.   -b host      Name of secondary log host (optional) 
  9.   -f facility  Facility level of syslog message 
  10.   -l level     Minimum level to send to syslog.\n", stderr); 
  11.            0=All/Verbose, 1=Critical, 2=Error, 3=Warning, 4=Info 
  12.   -n           Include only those events specified in the config file. 
  13.   -p port      Port number of syslogd 
  14.   -q bool      Query the Dhcp server to obtain the syslog/port to log to 
  15.                (0/1 = disable/enable) 
  16.   -s minutes   Optional interval between status messages. 0 = Disabled 
  17.  
  18. Default port: 514 
  19. Default facility: daemon 
  20. Default status interval: 0 
  21. Host (-h) required if installing. 

The following are Windows logs displayed on Loganalyzer, which are obvious windows logs. It is easy to monitor Linux logs. You can directly modify the configuration file and send the logs to the log server.

650) this. width = 650; "src =" http://www.bkjia.com/uploads/allimg/131227/1T325A25-6.jpg "border =" 0 "alt =" "/>

 

This article is from the blog, please be sure to keep this source http://gm100861.blog.51cto.com/1930562/1191164

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.