rsyslog+loganalyzer+evtsys搭建集中式監控系統
一、服務端的安裝
YUM源新建,如果有的話,可以省略
- # cat >> /etc/yum.repos.d/sohu.repo <<EOF
- [sohu]
- name=sohu`s mirrors
- baseurl=http://mirrors.sohu.com/centos/5/os/x86_64/
- enabled=1
- gpgcheck=0
- EOF
安裝LAMP環境及rsyslog,如果有LAMP,只需要安裝rsyslog rsyslog-mysql即可
- yum install rsyslog rsyslog-mysql mysql mysql-devel mysql-server php php-mysql php-pdo php-common php-gd httpd
匯入rsyslog資料庫
- mysql -u root -p < $(rpm -ql rsyslog-mysql | grep sql$)
建立資料庫使用者
- mysql -u root -p
- mysql> grant all privileges on Syslog.* to logger@localhost identified by `logger`;
- mysql> flush privileges;
- mysql> exit;
修改rsyslog的配置檔案
- # vi /etc/rsyslog.conf //修改一下即可
- # Use traditional timestamp format
- $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
- # Provides kernel logging support (previously done by rklogd)
- # Provides support for local system logging (e.g. via logger command)
- $ModLoad immark
- $ModLoad imuxsock
- $ModLoad imklog
- $ModLoad ommysql
- *.* :ommysql:127.0.0.1,Syslog,logger,logger
- $ModLoad imudp.so
- $UDPServerRun 514
- # 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 a special file.
- uucp,news.crit /var/log/spooler
- # Save boot messages also to boot.log
- local7.* /var/log/boot.log
紅色部分是新增的,其它的對比一下,有的就略過,沒的就新增一下吧。
安裝LogAnalyzer
- # wget http://download.adiscon.com/loganalyzer/loganalyzer-3.6.3.tar.gz
- # tar xf loganalyzer-3.6.3.tar.gz
- # mkdir /var/www/html/loganalyzer
- # mv loganalyzer-3.6.3/src/* /var/www/html/loganalyze
- # touch /var/www/html/loganalyzer/config.php
- # chmod 666 /var/www/html/loganalyzer/config.php
通過瀏覽器安裝即可
以上就完成了loganalyzer的安裝,登陸檢視
二、Windows客戶端安裝
下載evtsys http://code.google.com/p/eventlog-to-syslog/
- 解壓縮放到 C:WindowsSystem32
- evtsys -i -s 10 -h log-server-ip -p 514
- net start evtsys
在安裝的時候,會報一個錯誤,是配置檔案的問題,可以忽略不用管,只要看到最後的安裝成功即可。以下附上詳細的引數
- Version: 4.4 (32-bit)
- Usage: evtsys.exe -i|-u|-d [-h host] [-b host] [-f facility] [-p port]
- [-s minutes] [-l level] [-n]
- -i Install service
- -u Uninstall service
- -d Debug: run as console program
- -h host Name of log host
- -b host Name of secondary log host (optional)
- -f facility Facility level of syslog message
- -l level Minimum level to send to syslog.
“, stderr); - 0=All/Verbose, 1=Critical, 2=Error, 3=Warning, 4=Info
- -n Include only those events specified in the config file.
- -p port Port number of syslogd
- -q bool Query the Dhcp server to obtain the syslog/port to log to
- (0/1 = disable/enable)
- -s minutes Optional interval between status messages. 0 = Disabled
- Default port: 514
- Default facility: daemon
- Default status interval: 0
- Host (-h) required if installing.
以下是在Loganalyzer上看到的Windows的日誌,很明顯的windows日誌。監控Linux日誌就很簡單了,直接修改配置檔案,把日誌傳送一份到日誌伺服器即可,這裡不再詳細的說明。
本文轉自 gm100861 51CTO部落格,原文連結:http://blog.51cto.com/gm100861/1191164
相關文章
- python搭建系統監控Python
- Nagios監控系統搭建iOS
- 搭建完美的監控系統
- 前端監控系統Sentry搭建前端
- 搭建前端錯誤監控系統前端
- 前端監控基礎篇 — Docker + Sentry 搭建前端監控系統前端Docker
- 轉轉支付通道監控系統的搭建
- grafana+prometheus快速搭建MySql監控系統實踐GrafanaPrometheusMySql
- docker-compose 搭建 Prometheus+Grafana監控系統DockerPrometheusGrafana
- 搭建一個前端監控系統,不再錯過BUG前端
- Mysql 監控系統MySql
- 監控系統元件元件
- 能源管控系統開發解決方案,線上監測系統搭建
- 實時監控系統,統一監控企業APIAPI
- docker-compose快速搭建 Prometheus+Grafana監控系統DockerPrometheusGrafana
- 能耗線上管理平臺搭建能源監控系統開發
- 智慧警務視覺化應用監控系統搭建視覺化
- 搭建服務端效能監控系統 Prometheus 詳細指南服務端Prometheus
- Mac系統監控工具Mac
- 打造前端監控系統前端
- 手刃前端監控系統前端
- JavaWeb的監控系統JavaWeb
- Cacti 監控 AIX 系統AI
- 智慧工地監控系統
- 智慧影片監控系統
- 搭建Cacti監控
- 工廠能源管控系統開發解決方案,線上監測系統搭建
- 「玩轉樹莓派」搭建智慧家居遠端監控系統樹莓派
- 從零開始搭建ELK+GPE監控預警系統
- 系統監控&JVM監控指標資料查詢JVM指標
- 運維監控系統 PIGOSS BSM的監控策略運維Go
- 駕駛員監控系統(DMS)
- sysstat——系統效能監控神器
- Docker 容器監控系統初探Docker
- Prometheus監控報警系統Prometheus
- 直播間截留監控系統
- zabbix系統監控部署(上)
- fanotify 監控檔案系統