°Ô½Ã¹° 1,358°Ç
   
¿ø°ÝÅëÇշα׼­¹ö (rsyslog + loganalyzer)
±Û¾´ÀÌ : ÃÖ°í°ü¸®ÀÚ ³¯Â¥ : 2012-03-30 (±Ý) 10:57 Á¶È¸ : 18726
±ÛÁÖ¼Ò :
                                
¡Ø °¢½Ã½ºÅÛ ·Î±×¸¦ ·Î±×ÅëÇÕ¼­¹ö¿¡ ¿ø°Ý º¸°üÇÏ°í À¥¿¡¼­ ¸ð´ÏÅ͸µÇÏ´Â ¹æ¹ýÀÔ´Ï´Ù.
¿ø°Ý·Î±× ¼³Á¤ÀÌ µÇ¾îÀÖ´Â ¼­¹ö´Â ÅëÇÕ¼­¹ö¿¡ ·Î±×À» ±â·ÏÇϸç ÅëÇÕ¼­¹ö¿¡¼­´Â MYSQL DB·Î ÀúÀå°ü¸®ÇÏ´Â ¹æ½ÄÀÔ´Ï´Ù.


1. ·Î±× ÅëÇÕ¼­¹ö 
# yum -y install rsyslog rsyslog-mysql 
# yum mysql* php53* httpd*
# chkconfig rsyslog on 
# service rsyslog start


1) mysql ¼³Á¤ 
 - µ¥ÀÌŸ ÃʱâÈ­
# mysql -u root  < /usr/share/doc/rsyslog-mysql-3.22.1/createDB.sql

 - ±ÇÇÑ ¹× À¯Àú »ý¼º
mysql> create user 'rsyslog'@'localhost' identified by 'rsyslog';
mysql> grant all on Syslog.* to 'rsyslog'@'localhost' with grant option;
mysql> flush privileges;
mysql> exit; 

2) rsyslog ¼³Á¤
# cat /etc/rsyslog.conf 
# Use traditional timestamp format
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat

# Provides kernel logging support (previously done by rklogd)
$ModLoad imklog
# Provides support for local system logging (e.g. via logger command)
$ModLoad imuxsock
$UDPServerRun 514

$ModLoad ommysql.so
$template dbFormat,"insert into SystemEvents (Message, Facility, FromHost, Priority, DeviceReportedTime, ReceivedAt, InfoUnitID, SysLogTag) values ('%msg%', %syslogfacility%, '%FROMHOST%', %syslogpriority%, '%timereported:::date-mysql%', '%timegenerated:::date-mysql%', %iut%, '%syslogtag%')",SQL
*.info;mail.none;authpriv.none;cron.none :ommysql:localhost,Syslog,rsyslog,rsyslog;dbFormat

# 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

# /etc/sysconfig/rsyslog
SYSLOGD_OPTIonS="-r -m 0"


3). À¥¼­¹ö ¼³Á¤
# wget http://download.adiscon.com/loganalyzer/loganalyzer-3.5.1.tar.gz
# tar zxvf loganalyzer-3.5.1.tar.gz
# mv ./loganalyzer-3.5.1/src /var/www/html/syslog 
# mv ./loganalyzer-3.5.1/contrib/* /var/www/html/syslog 
# cd /var/www/html/syslog 
# chmod u+x configure.sh secure.sh 
# ./configure.sh 













2. Ŭ¶óÀ̾ðÆ® (·Î±×Àü¼Û ¼­¹ö)
ºÒÇÊ¿äÇÑ snmpd µ¥¸ó ·Î±× ³²±âÁö ¾Ê°Ô ¼öÁ¤
 /etc/init.d/snmpd
±âÁ¸ : OPTIonS="-Lsd -Lf /dev/null -p /var/run/snmpd.pid -a"
¼öÁ¤ : OPTIonS="-LS 2 d -Lf /dev/null -p /var/run/snmpd.pid -a"

# /etc/rsyslog.conf    ¾Æ·¡¶óÀÎ Ãß°¡
*.info;mail.none;authpriv.none;cron.none                @XXX.XXX.XXX.XXX (·Î±×ÅëÇÕ ¼­¹ö)

-r enables logging from remote machines
# /etc/sysconfig/rsyslog    
¾Æ·¡ ¶óÀÎ Ãß°¡
SYSLOGD_OPTIonS="-r -m 0"


¾Æ·¡¿Í °°ÀÌ ·Î±×µ¥ÀÌŸ ¹× Åë°è ÆäÀÌÁö¸¦ È®ÀÎÇÒ¼ö ÀÖ½À´Ï´Ù.
1000´ë 10000´ëµç ´Ù·®¿¡ ½Ã½ºÅÛ ·Î±× °ü¸®Çϱ⿡´Â µüÀÎµí ½Í½À´Ï´Ù.





·Î±× °Ë»ö 


Err
 rsyslogd: UDP message reception disabled due to error logged in last message.
 --> 
·Î±×¼­¹ö   
SYSLOGD_OPTIonS="-r514 -m 0" 

À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

 



 
»çÀÌÆ®¸í : ¸ðÁö¸®³× | ´ëÇ¥ : ÀÌ°æÇö | °³ÀÎÄ¿¹Â´ÏƼ : ·©Å°´åÄÄ ¿î¿µÃ¼Á¦(OS) | °æ±âµµ ¼º³²½Ã ºÐ´ç±¸ | ÀüÀÚ¿ìÆí : mojily°ñ¹ðÀÌchonnom.com Copyright ¨Ï www.chonnom.com www.kyunghyun.net www.mojily.net. All rights reserved.