Æí¸®ÇÑ È£½ºÆà ¹Ì¼ÒIDC

   
 
 
 

      1Â÷ ³×ÀÓ¼­¹ö :
      ns1.misoidc.com
      101.79.73.101

      2Â÷ ³×ÀÓ¼­¹ö :
      ns2.misoidc.com
      101.79.73.105

      ¾îÁ¦ : 352 ,¿À´Ã : 111
      Àüü : 1,158,252


     

 

 
ÀÛ¼ºÀÏ : 12-05-21 18:19
rsyslog + LogAnalyzer
 ±Û¾´ÀÌ : ½ÑÀ¥È£½ºÆÃ
Á¶È¸ : 56,218  
   http://blog.redbranch.net/2011/03/04/rsyslog-and-log-analyzer/ [14576]

These are the steps I took to create a centralised location of system logs. In this scenario multiple servers (earth, venus, mars) send their system logs to a central server (sun 192.168.1.1). I¡¯m not going to cover the configuration of Apache, MySql except were it applies to Log Analyzer. Most of the servers are running Red Hat / CentOS 5. In this setup I am using 192.168.0.0 as the subnet and topsecret as the password. Change as appropriate. More info here.

Central Server (sun):

On the central server (sun) which will be running Log Analyzer, these steps only need to be taken once. If you only want to add more servers sending their syslogs to sun skip this section:

yum install httpd php mysql php-mysql mysql-server wget rsyslog rsyslog-mysql

Create the rsyslog database structure in MySQL:

mysql -u root -p < /usr/share/doc/rsyslog-mysql-3.22.1/createDB.sql

Create the MySQL user:

mysql -u root -p mysql
mysql> GRANT ALL ON Syslog.* TO rsyslog@localhost IDENTIFIED BY ¡®topsecret¡¯;
mysql> flush privileges;
mysql> exit

Edit the rsyslog config file:

vi /etc/rsyslog.conf

Add the following at the top:

$AllowedSender UDP, 127.0.0.1, 192.168.0.0/16
$AllowedSender TCP, 127.0.0.1, 192.168.0.0/16

#UDP log
$ModLoad imudp
$UDPServerRun 514
#TCP log
$ModLoad imtcp
$InputTCPServerRun 514

$ModLoad ommysql
*.info :o mmysql:127.0.0.1,Syslog,rsyslog,topsecret

Amend the rsyslog startup options:

vi /etc/sysconfig/rsyslog

<IFRAME style="POSITION: absolute; TOP: 0px; LEFT: 0px" id=aswift_0 height=60 marginHeight=0 frameBorder=0 width=468 allowTransparency name=aswift_0 marginWidth=0 scrolling=no></IFRAME>

Set the options as follows:

SYSLOGD_OPTIonS=¡±-r -t154 -m 0¡È

Now disable the standard syslog and enable rsyslog:

chkconfig syslog off
service syslog stop
chkconfig rsyslog on
service rsyslog start

Install Log Analyzer:

cd /tmp
wget http://download.adiscon.com/loganalyzer/loganalyzer-3.0.7.tar.gz
tar xzf loganalyzer-3.0.7.tar.gz
mv loganalyzer-3.0.7/src /var/www/html/loganalyzer
mv loganalyzer-3.0.7/contrib/* /var/www/html/loganalyzer
cd /var/www/html/loganalyzer
chmod u+x configure.sh secure.sh
./configure.sh

Now browse the website e.g. http://sun/loganalyzer
Follow the installer adding your MySQL credentials when requested.

Amend the firewall on the central (sun) server to allow other servers:

vi /etc/sysconfig/iptables

Add:

-A RH-Firewall-1-INPUT -p udp -m udp –dport 514 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp –dport 514 -j ACCEPT

Restart iptables:

service iptables restart

Remote Servers
Configure Other Servers (mars, venus, earth) to send their syslogs to the central server (sun):
Install rsyslog:

yum install rsyslog

Edit the config:

vi /etc/rsyslog.conf

Add:

*.info @192.168.1.1:514

I add this on line number 2 below $ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
Set rsyslog as the default syslogger:

/sbin/chkconfig syslog off
/sbin/chkconfig rsyslog on
service syslog stop
service rsyslog start

Using *.info could collect a lot of messages so customise as necessary, for example changing to *.crit will collect less messages of higher importance.



 
 

Total 78
¹øÈ£ Á¦   ¸ñ ±Û¾´ÀÌ ³¯Â¥ Á¶È¸
78 centos 6.2 oracle 10g ¼³Ä¡ (2) ½ÑÀ¥È£½ºÆà 12-17 333298
77 [Linux] Çϵå¿þ¾î Á¤º¸ È®ÀÎÇϱâ - dmidecode, lshw ½ÑÀ¥È£½ºÆà 03-06 222828
76 CentOS - Apache + SVN + Trac ¿¬µ¿ ½ÑÀ¥È£½ºÆà 02-16 196593
75 jsp °èÁ¤ ¼ÂÆðú ¹öÃß¾óÈ£½ºÆ® ¼³Á¤ ½ÑÀ¥È£½ºÆà 06-28 176172
74 [Àåºñ] OmniSwitch 6850-24x L2/L3 ½ºÀ§Ä¡ ¼³Á¤ ½ÑÀ¥È£½ºÆà 03-05 158384
73 CentOS 5.5 VNC ¼³Á¤ ¹× »ç¿ë¹æ¹ý (1) ½ÑÀ¥È£½ºÆà 03-28 131391
72 ¿ìºÐÅõ¿¡ ffmpeg h.264 ¼³Ä¡ ½ÑÀ¥È£½ºÆà 11-01 125239
71 Oracle - sqlplus ·Î Á¢¼ÓÇϱâ, °èÁ¤»ý¼º, Å×À̺í»ý¼º ½ÑÀ¥È£½ºÆà 09-22 112344
70 Trac ¼³Ä¡ ¹× ¼³Á¤ ¸Þ´º¾ó ½ÑÀ¥È£½ºÆà 05-07 108998
69 PHP ¿Í MongoDB »ç¿ë¹ý ½ÑÀ¥È£½ºÆà 07-27 102009
68 [¸®´ª½º/NGINX] CentOs 5.7 64bit ¿¡¼­ NGINX + PHP + MYSQL + m¡¦ ½ÑÀ¥È£½ºÆà 01-13 84010
67 centos¿¡ oracle 11gR2 ¼³Ä¡ ½ÑÀ¥È£½ºÆà 09-21 81414
66 memcached Cacti Template ½ÑÀ¥È£½ºÆà 05-17 79517
65 ÅèĹ ¾ÆÆÄÄ¡ ¿¬µ¿½Ã °£´ÜÇÑ ¼³Á¤ ½ÑÀ¥È£½ºÆà 06-28 72646
64 HP¼­¹ö Çϵåµð½ºÅ©ÀÇ »óź¸±â ½ÑÀ¥È£½ºÆà 02-20 71060
 1  2  3  4  5  6