国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
loganalyzer+mysql+rsyslog中央日志服務(wù)器對syslog的web管理

(1)LAMP

yum install mysql mysql-devel mysql-server php php-mysql php-pdo php-common php-cli php-gd httpd -y

(2)下載、安裝rsyslog,需要先安裝2個依賴包

<1>下載libestr,http://libestr.adiscon.com/

tar zxf libestr-*.*.*.tar.gz

cd libestr-*.*.*

./configure --libdir=/usr/lib --includedir=/usr/include/

make && make install

<2>下載lbeehttp://www.libee.org

tar zxf libee-*.*.*.tar.gz

cd libee-*.*.*

./configure --libdir=/usr/lib --includedir=/usr/include/

make && make install

<3>下載rsyslog,http://www.rsyslog.com/download/

tar zxf rsyslog-*.*.*.tar.gz

cd rsyslog-*.*.*

./configure --enable-mysql --prefix=/usr/local/rsyslog

make && make install

3)配置rsyslog

<1>vi /etc/rsyslog.conf

-------------------------------------------------------------------------------------------

#if you experience problems, check

http://www.rsyslog.com/troubleshoot for assistance

rsyslog v3: load input modules

If you do not load inputs, nothing happens!

You may need to set the module load path if modules are not found.

 

 

$ModLoad immark provides --MARK-- message capability

$ModLoad imuxsock provides support for local system logging (e.g. via logger command)

$ModLoad imklog kernel logging (formerly provided by rklogd)

$ModLoad ommysql

*.* :ommysql:localhost,Syslog,user,passwd

#*.* :ommysql:database-server,database-name,database-userid,database-password

 

 

Log all kernel messages to the console.

Logging much else clutters up the screen.

#kern.* /dev/console

 

Log anything (except mail) of level info or higher.

Don't log private authentication messages!

*.info;mail.none;authpriv.none;cron.none -/var/log/messages

 

The authpriv file has restricted access.

authpriv.* /var/log/secure

 

Log all the mail messages in one place.

mail.* -/var/log/maillog

 

Log cron stuff

cron.* -/var/log/cron

 

Everybody gets emergency messages

*.emerg *

 

Save news errors of level crit and higher in special file.

uucp,news.crit -/var/log/spooler

Save boot messages also to boot.log

local7.* /var/log/boot.log

 

Remote Logging (we use TCP for reliable delivery)

An on-disk queue is created for this action. If the remote host is

down, messages are spooled to disk and sent when it is up again.

#$WorkDirectory /rsyslog/spool where to place spool files

#$ActionQueueFileName uniqName unique name prefix for spool files

#$ActionQueueMaxDiskSpace 1g 1gb space limit (use as much as possible)

#$ActionQueueSaveOnShutdowon save messages to disk on shutdown

#$ActionQueueType LinkedList run asynchronously

#$ActionResumeRetryCount -1 infinite retries if host is down

remote host is: name/ip:port, e.g. 192.168.0.1:514, port optional

#*.* @@remote-host:514

######### Receiving Messages from Remote Hosts ##########

TCP Syslog Server:

provides TCP syslog reception and GSS-API (if compiled to support it)

#$ModLoad imtcp.so load module

#$InputTCPServerRun 514 start up TCP listener at port 514

 

 

#UDP Syslog Server:

$ModLoad imudp.so provides UDP syslog reception

$UDPServerRun 514 start UDP syslog server at standard port 514

-------------------------------------------------------------------------------------------

<2>cp /etc/init.d/{syslog,rsyslog}

<3>sed -i 's/syslog/rsyslog/g' /etc/init.d/rsyslog

<4>chmod +x /etc/init.d/rsyslog

<5>ln -sv /usr/local/rsyslog/sbin/rsyslogd /sbin/rsyslogd

<6> /etc/init.d/syslog stop

<7> chkconfig syslog off 

<8> /etc/init.d/rsyslog start

<9> chkconfig rsyslog on

(4)配置mysql

<1>/etc/init.d/mysqld start

<2>chkconfig mysqld on

<3>mysqladmin -u root -p password passwd(root初始密碼為空)

/usr/bin/mysql_secure_installation設(shè)置root密碼,并進行安全設(shè)置。

<4>mysql -uroot -ppasswd rsyslog-*.*.*/plugins/ommysql/createDB.sql

<5>cat createDB.sql

-------------------------------------------------------------------------------------------

CREATE DATABASE Syslog;

USE Syslog;

CREATE TABLE SystemEvents

(

        ID int unsigned not null auto_increment primary key,

        CustomerID bigint,

        ReceivedAt datetime NULL,

        DeviceReportedTime datetime NULL,

        Facility smallint NULL,

        Priority smallint NULL,

        FromHost varchar(60) NULL,

        Message text,

        NTSeverity int NULL,

        Importance int NULL,

        EventSource varchar(60),

        EventUser varchar(60) NULL,

        EventCategory int NULL,

        EventID int NULL,

        EventBinaryData text NULL,

        MaxAvailable int NULL,

        CurrUsage int NULL,

        MinUsage int NULL,

        MaxUsage int NULL,

        InfoUnitID int NULL ,

        SysLogTag varchar(60),

        EventLogType varchar(60),

        GenericFileName VarChar(60),

        SystemID int NULL

);

 

CREATE TABLE SystemEventsProperties

(

        ID int unsigned not null auto_increment primary key,

        SystemEventID int NULL ,

        ParamName varchar(255) NULL ,

        ParamValue text NULL

);

-------------------------------------------------------------------------------------------

<6>mysql -uroot -ppasswd

>grant all privileges on Syslog.* to 'user'@localhost identified by 'passwd';

>quit

<7>/etc/init.d/rsyslog restart

<8>/etc/init.d/mysqld restart

<9>mysql -uuser -ppasswd

>use Syslog;

>select from SystemEvents;#有數(shù)據(jù)說明成功

(5)下載、安裝、配置loganalyzerhttp://loganalyzer.adiscon.com/downloads

<1>tar zxf loganalyzer-*.*.*.tar.gz

<2>cd loganalyzer-*.*.*

<3>cp -r src/ /var/www/html/loganalyzer

<4>cp -r contrib/* /var/www/html/loganalyzer

<5>chown -R apache.apahce /var/www/html/loganalyzer

<6>/bin/sh /var/www/html/loganalyzer/configure.sh

<7>/bin/sh /var/www/html/loganalyzer/secure.sh

6)啟動http,進入日志web界面

<1> /etc/init.d/httpd start

<2> chkconfig httpd on

訪問http://127.0.0.1/loganalyzerhttp://IP/loganalyzer,進入web頁面。

(7)web頁面配置

Here--->

一直next--->


將最下面一項更改為yes,然后設(shè)置內(nèi)容如下,注意Database NameSyslog,我之前設(shè)置的用戶是userpasswd):


next--->


填寫用戶和密碼后next--->


這里注意:數(shù)據(jù)庫名為Syslog和數(shù)據(jù)庫表名為SystemEvents ,next--->


next--->


next--->


(8)接收遠程主機syslog信息

<1>vi /etc/syslog.conf

----------------------------------------------------------------------------------------------

*.*                          @loganalyzer's IP

----------------------------------------------------------------------------------------------

<2>/etc/init.d/syslog restart

logger命令測試,在loganalyzer web界面中查看、管理遠程log日志。

這里在loganalyzer主機的tail -f /var/log/message中也可以看到客戶機的syslog message,而之前的graylog2graylog2 server機上的/var/log/message中不能看到客戶機的syslog message。我理解的是graylog2 主機直接將遠程主機發(fā)來的message存到了mongodb中,可能和端口(轉(zhuǎn)發(fā))的處理有關(guān)系,希望有高手能深入的解釋說明下!而loganalyzer主機是將遠程主機發(fā)來的syslog message傳到本地的rsyslogmessage,并將這些message存到mysql中。


9web界面

<1>在主頁面上的

選項可以調(diào)整更新頻率,我這里設(shè)置的是每5s更新日志信息。

<2>

選項即進入搜索查詢界面,可根據(jù)不同條件進行日志的搜索、查詢,非常方便。


本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報。
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
CentOS利用Rsyslog+LogAnalyzer+MySQL部署日志服務(wù)器centos
【原】無腦操作:Centos 7.6 + MariaDB + Rsyslog + LogAnalyzer環(huán)境搭建
CentOS 6.5+Rsyslog+LogAnalyzer搭建中央日志服務(wù)器 | Linux |
集中日志服務(wù)器Rsyslog | 人無完人,盡力改造!
Ubuntu Linux sudo日志記錄配置
配置rsyslog,實現(xiàn)設(shè)備日志的集中管理
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服