If a central ‘‘syslog’’ logging server is used within a Univention Corporate Server (UCS) domain, one might want to connect Microsoft Windows servers and clients to it. Therefore, the Eventlog-to-Syslog service might be used.
This article describes the setup of the service.
The shown procedure works for all common Windows operating systems (XP, Vista, 7, 8, 8.1, 10, Server 2003, Server 2008, Server 2012)
Create a file called eventlog.conf within the directory /etc/rsyslog.d/ and insert the following content:
# Provides UDP syslog reception $ModLoad imudp $UDPServerRun 514
Explanation: At first, the input module for UDP (imudp) will be loaded to provide the ability to receive syslog messages via UDP. Then the UDP port on which the server listens is defined.
rsyslog has powerful features, including filters. You might want to have a look at the official documentation.
Save the config file and restart your rsyslog daemon:
service rsyslog restart
In the next step, a packet filter rule for the UDP server must be set. To do so, execute the following command:
ucr set security/packetfilter/package/rsyslog/udp/514/all=ACCEPT
Afterwards, restart the univention-firewall:
service univention-firewall restart
The serverside installation is now complete.
The following steps must be executed on every client from which you want the eventlogs in your syslog file.
- Download the Eventlog-to-Syslog service from its Website
- Extract the .zip file
- Optional: Move the evtsys.exe somewhere more preferable, as it is going to get installed as a service.
Note: The next steps must be made on the commandline on your Windows Client with an Administrative user.
Change in the directory you extracted from the .zip file. Execute the following command while replacing [syslog server] with the IP adress of your remote logging server:
evtsys.exe -i -h [syslog server]
Afterwards, activate the service with
net start evtsys
Note: The following additional command has to be executed under Windows 10, to make sure, that the service will get started automatically on reboot:
REG ADD "HKLM\SYSTEM\CurrentControlSet\Services\EvtSys" /f /v "DependOnService" /t REG_MULTI_SZ /d eventlog\0LanmanServer\0netman
Now, you should see the first log entries on your syslog server in /var/log/syslog. Log entries from your Windows clients always start with their hostname in front of the log messages.