Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] Re: Receiving syslog entries over network with systemd
Date: Sat, 06 May 2017 17:41:47
Message-Id: 4115750.cTfjHC05HG@dell_xps
In Reply to: [gentoo-user] Receiving syslog entries over network with systemd by Mick
1 On Thursday 04 May 2017 15:35:58 Mick wrote:
2 > Hi All,
3 >
4 > I hope this post is not completely off topic. I have a small LAN server
5 > (with Kodi) running systemd and I want to use it to receive and store
6 > syslog entries from other devices over the LAN. I want to keep this system
7 > as lightweight as possible, due to its constrained hardware. What is the
8 > best way to go about it and how should I configure systemd? Please be
9 > detailed with your explanations on systemd - my knowledge on this init
10 > system and its manifold applications is quite limited.
11
12 It was straight forward. Install syslog-ng, add a configuration to accept
13 logs over UDP and install logrotate, which brought in cron and configured the
14 required cron job.
15
16 This is the additional configuration file I had to create:
17
18 $ cat /etc/syslog-ng/conf.d/remote.conf
19 source net { source net { udp(); };
20 destination remote { file("/var/log/remote/${FULLHOST}-log"); };
21 log { source(net); destination(remote); };
22
23 I also tried this stanza to bind a LAN IP address for the syslog-ng host to
24 listen to for connections from the LAN devices, but then syslog-ng failed to
25 start:
26
27 source net { syslog(ip(192.168.1.25) transport ("udp")); };
28
29 Perhaps the ethernet was not up at the time and after a few attempts syslog-ng
30 gave up. I was able to start it manually after boot though.
31 --
32 Regards,
33 Mick

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] Re: Receiving syslog entries over network with systemd Alan McKinnon <alan.mckinnon@×××××.com>