📜 ⬆️ ⬇️

Centralized collection, storage and viewing of Syslog on Debian Linux

Rsyslog is used as the standard syslog service in Debian. The following describes how to send copies of the logs to the server, save them in the SQL database and view them through a convenient web interface.


Sending from client machines to the central server


Create the file /etc/rsyslog.d/send2server with the line:
*.* @hostname--fqdn--ip--
For example:
*.* @netlog.lan
In order not to collect debugging garbage, you can replace "*. *" With "* .notice" or "* .warning".
Re-read settings: /etc/init.d/rsyslog restart

Delivery protocol



')

Reception on the server


The following lines should be uncommented in /etc/rsyslog.conf:
$ModLoad imudp
$UDPServerRun 514

$ModLoad imtcp
$InputTCPServerRun 514

Re-read settings: /etc/init.d/rsyslog restart

MySQL storage




View in LogAnalyzer




Preparing SQL databases for LogAnalyzer



The LogAnalyzer standard format Syslog.SystemEvents automatically adds its own columns to the SQL table, but this will require giving it too much privilege. To allow it only SELECT, create the columns manually:
ALTER TABLE `SystemEvents` ADD `processid` varchar(60) NOT NULL DEFAULT '';
ALTER TABLE `SystemEvents` ADD `checksum` int(11) UNSIGNED NOT NULL DEFAULT '0';



Configuring LogAnalyzer



After installation is complete:
chmod 644 config.php
rm install.php

The first user has administrator rights.
It is recommended to log into the “Admin Center / Users” and register a guest with the “ReadOnly User” flag.

Source: https://habr.com/ru/post/136537/


All Articles