... # Adiscon stable repository deb http://ubuntu.adiscon.com/v7-stable precise/ deb-src http://ubuntu.adiscon.com/v7-stable precise/ ...
# apt-key adv --recv-keys --keyserver keyserver.ubuntu.com AEF0CF8E # gpg --export --armor AEF0CF8E | sudo apt-key add -
# apt-get update # apt-get install rsyslog rsyslog-mysql mysql-server mysql-client
# vim /etc/rsyslog.d/mysql.conf ### Configuration file for rsyslog-mysql ### Changes are preserved $ModLoad ommysql *.* :ommysql:localhost,Syslog,rsyslog,p@ssw0rD
mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | Syslog | | mysql | | performance_schema | | test | +--------------------+ mysql> use Syslog; mysql> show tables; +------------------------+ | Tables_in_Syslog | +------------------------+ | SystemEvents | | SystemEventsProperties | +------------------------+ mysql> select * from SystemEvents limit 2 \G *************************** 1. row *************************** ID: 1 CustomerID: NULL ReceivedAt: 2014-02-11 04:22:52 DeviceReportedTime: 2014-02-11 04:22:52 Facility: 5 Priority: 6 FromHost: loganalyzer Message: [origin software="rsyslogd" swVersion="8.1.5" x-pid="11992" x-info="http://www.rsyslog.com"] start ... InfoUnitID: 1 SysLogTag: rsyslogd: EventLogType: NULL GenericFileName: NULL SystemID: NULL *************************** 2. row *************************** ID: 2 CustomerID: NULL ReceivedAt: 2014-02-11 04:22:52 DeviceReportedTime: 2014-02-11 04:22:52 Facility: 5 Priority: 6 FromHost: loganalyzer Message: rsyslogd's groupid changed to 103 ... InfoUnitID: 1 SysLogTag: rsyslogd: EventLogType: NULL GenericFileName: NULL SystemID: NULL 2 rows in set (0.00 sec) mysql>
# vim /etc/rsyslog.conf ... $ModLoad imudp $UDPServerRun 514 # provides TCP syslog reception $ModLoad imtcp $InputTCPServerRun 514 ...
# aptitude install apache2 libapache2-mod-php5 php5-mysql php5-gd
# mkdir /tmp/loganalyzer # cd /tmp/loganalyzer # wget http://download.adiscon.com/loganalyzer/loganalyzer-3.6.5.tar.gz # tar zxvf loganalyzer-3.6.5.tar.gz # mkdir /var/www/loganalyzer # mv loganalyzer-3.6.5/src/* /var/www/loganalyzer # mv loganalyzer-3.6.5/contrib/* /var/www/loganalyzer # chmod +x /var/www/loganalyzer/configure.sh /var/www/loganalyzer/secure.sh # ./configure.sh && ./secure.sh # chown -R www-data:www-data /var/www/loganalyzer
# cd /etc/apache2/sites-available # cp default loganalyzer.conf # vim loganalyzer.conf
<VirtualHost *:80> ServerAdmin webmaster@localhost ServerName loganalyzer-mysql.ip #<<---insert your domainname here DocumentRoot /var/www/loganalyzer #<<---insert root directory of unpacked Loganalyzer <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/ <Directory "/usr/lib/cgi-bin"> AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog ${APACHE_LOG_DIR}/access.log combined Alias /doc/ "/usr/share/doc/" <Directory "/usr/share/doc/"> Options Indexes MultiViews FollowSymLinks AllowOverride None Order deny,allow Deny from all Allow from 127.0.0.0/255.0.0.0 ::1/128 </Directory> </VirtualHost>
# a2ensite loganalyzer.conf # a2dissite 000-default # apachectl configtest # service apache2 restart
# vim /etc/rsyslog.conf ... *.* @@192.168.1.51 ...
# vim /etc/rsyslog.d/mongo.conf $ModLoad imfile $InputFileName /var/log/mongodb/mongodb.log $InputFileTag mongodb: $InputFileStateFile stat-mongo-error $InputFileSeverity error $InputFileFacility daemon $InputRunFileMonitor error.* @@192.168.1.51
Feb 17 17:27:05 loganalyzer - mongo mongodb : Sun Feb 16 7:26:13 [ clientcursormon ] mem (MB ) res : 15 virt : 624 mapped : 0
Source: https://habr.com/ru/post/213519/
All Articles