Syslog is a client/server protocol that deals with the generation, transmission, and storage of system messages. The purpose of syslog as the name indicates is to write system messages to a log file – each system message is supposed to result in an entry in the log file. A system administrator can analyze the messages in the log file as needed and the log file may be stored locally on the device generating system messages as well as on a remote logging host
# apt-get update
# apt-get upgrade -y
# apt-get install rpi-update
# rpi-update
# apt-get clean
# apt-get install rsyslog
# vi /etc/rsyslog.conf
# provides UDP syslog reception
$ModLoad imudp
$UDPServerRun 514
# provides TCP syslog reception
$ModLoad imtcp
$InputTCPServerRun 514
# vi /etc/rsyslog.d/loghost.conf
# Logfile for each host
$template DynaFile,“/var/log/syslog-%HOSTNAME%.log“
*.* -?DynaFile
# service rsyslog restart
# tail -f /var/log/messages
# echo „This is a test message over tcp“ | nc [loghost-ip-adresse] 514
# vi /etc/rsyslog.d/logclient.conf
*.* @@[loghost-ip-adresse]:514
# logger „This is a test message“
This entry was posted on Sonntag, August 28th, 2016 at 14:12 and is filed under Administration, Raspberry Pi. You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.