Rsyslog + loganalyzer Log Server SETUP

Source: Internet
Author: User
Tags import database rsyslog

Server installation:

To prevent installation errors, you must first set the environment variables and the required software packages.

1. Configure Environment Variables

[root@zhu3 ~]# echo $PATH/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin[root@zhu3 ~]# export PATH=/opt/mysql/bin/:$PATH[root@zhu3 ~]# echo $PATH/opt/mysql/bin/:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

2. Install the libestr package

wget http://libestr.adiscon.com/files/download/libestr-0.1.5.tar.gztar zxvf libestr-0.1.5.tar.gzcd libestr-0.1.5./configuremake && make install

3. Install the json package

wget https://github.com/json-c/json-c/archive/json-c-0.11-20130402.tar.gz --no-check-certificatetar zxvf json-c-0.11-20130402cd json-c-json-c-0.11-20130402/./configuremake && make install

4. Install the python-docutils package

Wget https://pypi.python.org/packages/source/d/docutils/docutils-0.11.tar.gz -- no-check-certificatetar zxvf docutils-0.11.tar.gzcd docutils-0.11python setup. py install # installation found that there is still no rst2man file in the/usr/bin directory, [root @ zhu2 ~] # Ll/usr/bin/| grep rst-rwxr-xr-x 1 root 593 09-10 17:19 rst2html. py-rwxr-xr-x 1 root 790 09-10 rst2latex. py-rwxr-xr-x 1 root 599 09-10 rst2man. py-rwxr-xr-x 1 root 1697 09-10 rst2odt_prepstyles.py-rwxr-xr-x 1 root 763 09-10 rst2odt. py-rwxr-xr-x 1 root 600 09-10 rst2pseudo doxml. py-rwxr-xr-x 1 root 636 09-10 rst2s5. py-rwxr-xr-x 1 root 785 09-10 rst2xetex. py-rwxr-xr-x 1 root 601 09-10 rst2xml. py-rwxr-xr-x 1 root 669 09-10 rstpep2html. py

A soft connection is required.

[root@zhu2 ~]# ln -s /usr/bin/rst2man.py /usr/bin/rst2man[root@zhu2 ~]# ll /usr/bin/rst2manlrwxrwxrwx 1 root root 19 09-10 17:21 /usr/bin/rst2man -> /usr/bin/rst2man.py

5. Install uuid-related software

yum -y install uuid uuid-devel libuuid libuuid-devel

All the packages required to install rsyslog have been installed.

6. Install rsyslog Software

[root@zhu2 ~]# wget http://www.rsyslog.com/files/download/rsyslog/rsyslog-7.4.3.tar.gz[root@zhu2 ~]# tar zxvf rsyslog-7.4.3.tar.gz[root@zhu2 ~]# cd rsyslog-7.4.3[root@zhu2 ~]# ./configure --prefix=/opt/rsyslog --enable-mysql PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/

7. Import Database

[Root @ zhu2 ~] # Cd rsyslog-7.4.3/plugins/ommysql/[root @ zhu2 ommysql] # ll total 56drwxrwxr-x 2 1000 1000 4096 07-18 contrib-rw-r -- 1 1000 1000 1046 2012-04-04 createDB. SQL-rw-r -- 1 1000 1000 274 Makefile. am-rw-r -- 1 1000 1000 21324 07-18 Makefile. in-rw-r -- 1 1000 1000 15563 07-15 ommysql. c-rw-r -- 1 1000 1000 1080 ommysql. h [root @ zhu2 ommysql] # mysql-uroot-p123456 <createDB. SQL

8. modify the configuration file to support mysql databases.

Vim/etc/rsyslog. conf # Add the following two lines $ ModLoad ommysql *. *: ommysql: localhost, Syslog, root, 123456 # uncomment the following lines $ ModLoad imuxsock $ ModLoad imklog $ ModLoad immark $ ModLoad imudp $ UDPServerRun 514 $ ModLoad imtcp $ InputTCPServerRun 514

9. Set the rsyslogd Startup Script

cp -rf /etc/init.d/syslog /etc/init.d/rsyslogdsed -i 's/syslog/rsyslog/g' /etc/init.d/rsyslogdln -s /opt/rsyslog/sbin/rsyslogd /sbin/rsyslogd

Install loganalyzer-3.6.3.tar.gz

[Root @ zhu2 ~] # Wgethttp: // download.adiscon.com/loganalyzer/loganalyzer-3.6.3.tar.gz

[root@zhu2 ~]# wget http://download.adiscon.com/loganalyzer/loganalyzer-3.6.3.tar.gz[root@zhu2 ~]# tar zxvf loganalyzer-3.6.3.tar.gz[root@zhu2 ~]# cd loganalyzer-3.6.3[root@zhu2 loganalyzer-3.6.3]#[root@zhu2 loganalyzer-3.6.3]# mkdir /opt/nginx/html/rsyslog[root@zhu2 loganalyzer-3.6.3]# mv src/* /opt/nginx/html/rsyslog/[root@zhu2 loganalyzer-3.6.3]# mv contrib/* /opt/nginx/html/rsyslog/[root@zhu2 loganalyzer-3.6.3]# chmod +x /opt/nginx/html/rsyslog/*.sh[root@zhu2 loganalyzer-3.6.3]# cd /opt/nginx/html/rsyslog[root@zhu2 rsyslog]# ./configure.sh[root@zhu2 rsyslog]# ./secure.sh[root@zhu2 rsyslog]# chmod 666 config.php[root@zhu2 rsyslog]# chown -R www.www *

11.

Enter http: // ip/syslog in the browser and install the system as follows:

650) this. width = 650; "style =" width: 740px; float: none; height: 162px; "title =" image 1.png "src =" http://www.bkjia.com/uploads/allimg/131228/0549545Y4-0.png "width =" 1110 "height =" 232 "alt =" 110457522.png"/>

650) this. width = 650; "style =" width: 921px; float: none; height: 208px; "title =" image 2.png "src =" http://www.bkjia.com/uploads/allimg/131228/054954M29-1.png "width =" 1200 "height =" 325 "alt =" 110500371.png"/>

650) this. width = 650; "style =" width: 889px; float: none; height: 159px; "title =" image 3.png "src =" http://www.bkjia.com/uploads/allimg/131228/0549546362-2.png "width =" 1200 "height =" 237 "alt =" 110502742.png"/>

650) this. width = 650; "style =" width: 892px; float: none; height: 178px; "title =" image 4.png "src =" http://www.bkjia.com/uploads/allimg/131228/054954H64-3.png "width =" 1200 "height =" 505 "alt =" 110504599.png"/>

650) this. width = 650; "style =" width: 948px; float: none; height: 224px; "title =" image 5.png "src =" http://www.bkjia.com/uploads/allimg/131228/0549545B2-4.png "width =" 1200 "height =" 349 "alt =" 110507793.png"/>

650) this. width = 650; "style =" width: 917px; float: none; height: 189px; "title =" image 6.png "src =" http://www.bkjia.com/uploads/allimg/131228/05495421I-5.png "width =" 1200 "height =" 188 "alt =" 110509619.png"/>

650) this. width = 650; "style =" float: none; height: 4px; "title =" image 7.png "src =" http://www.bkjia.com/uploads/allimg/131228/0549543192-6.png "width =" 1200 "height =" 346 "alt =" 110109872.png"/>

650) this. width = 650; "style =" width: 1044px; float: none; height: 133px; "title =" image 8.png "src =" http://www.bkjia.com/uploads/allimg/131228/05495414L-7.png "width =" 1200 "height =" 561 "alt =" 110514713.png"/>

650) this. width = 650; "style =" width: 817px; height: 157px; "title =" image 9.png "src =" http://www.bkjia.com/uploads/allimg/131228/0549546412-8.png "width =" 1200 "height =" 333 "alt =" 110516973.png"/>

650) this. width = 650; "style =" width: 955px; float: none; height: 186px; "title =" image 10.png "src =" http://www.bkjia.com/uploads/allimg/131228/0549545027-9.png "width =" 1200 "height =" 356 "alt =" 110519713.png"/>

650) this. width = 650; "style =" width: 988px; float: none; height: 129px; "title =" image 11.png "src =" http://www.bkjia.com/uploads/allimg/131228/05495463Z-10.png "width =" 986 "height =" 322 "alt =" 110521269.png"/>

650) this. width = 650; "style =" width: 1024px; float: none; height: 133px; "title =" image 12.png "src =" http://www.bkjia.com/uploads/allimg/131228/0549542P9-11.png "width =" 1200 "height =" 130 "alt =" 110524279.png"/>

650) this. width = 650; "style =" width: 821px; float: none; height: 242px; "title =" image 13.png "src =" http://www.bkjia.com/uploads/allimg/131228/054954J37-12.png "width =" 1106 "height =" 333 "alt =" 110527853.png"/>

Client Configuration:

Directly use the built-in syslog software to modify its configuration file

/Etc/syslog. conf

Add

*. * @ Server IP Address

This article is from the "Lang taosha" blog, please be sure to keep this source http://caisangzi.blog.51cto.com/6387416/1297564

Related Article

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.