Editing How to make your NAS a SYSLOG Server

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
Note: As of DSM 3.0 Syslog-ng is part of the NAS firmware, and as of DSM 4.0 Syslog Server functionality is provided as an application. Hence if you have DSM3 see this wiki's discussion page for more information on how to access the built in syslog-ng. If you have DSM4 you may not need this wiki at all depending on exactly what you want to achieve.
This wiki gives step by step instructions on how to add SysLog Server functionality to your NAS by installing [http://www.balabit.com/network-security/syslog-ng/opensource-logging-system/ syslog-ng]. After completing this modification your NAS can log the System messages from other devices on your network (if they support send to SysLog Server functionality). If installed and configured as per this wiki, syslog-ng will not affect your NAS's internal system logging (klogd and syslogd) which will carry on working as normal.  
This wiki gives step by step instructions on how to add SysLog Server functionality to your NAS by installing [http://www.balabit.com/network-security/syslog-ng/opensource-logging-system/ syslog-ng]. After completing this modification your NAS can log the System messages from other devices on your network (if they support send to SysLog Server functionality). If installed and configured as per this wiki, syslog-ng will not affect your NAS's internal system logging (klogd and syslogd) which will carry on working as normal.  


This wiki was written after making the modification to a DS-207+ and CS-407 running DSM2, it should work on all other Synology models and firmware versions.
This wiki was written after making the modification to a DS-207+ and CS-407, it will almost certainly work on all other Synology models and firmware versions.


==What is a SysLog Server==
==What is a SysLog Server==
Line 18: Line 16:


If acting as a SysLog Server adversely affects your NAS's performance it is easy to turn off this functionality or uninstall the software as detailed below.
If acting as a SysLog Server adversely affects your NAS's performance it is easy to turn off this functionality or uninstall the software as detailed below.
===How do I analyse System Message logs===
As the number of messages received by a SysLog server can be large (as discussed above) it is very beneficial to a) only collect the data you might be interested in and then filter/sort/group that data as it is received, and then b) use some form of data filtering and grouping software to analyse the logged data.
====Only collect the messages you are interested in====
Most devices that send out System Messages to a SysLog server will allow you select the types of messages to be sent. For instance a router may enable you to individually select items like: firewall log, VPN Log, User Access Log, Call Log, WAN Log, Router/DSL log, etc.
However if the sending device does not provide sufficient control then syslog-ng provides many tools for processing messages on receipt. syslog-ng enables you to set criteria for messages to be droped (not logged) or if they are to be kept you can set criteria for them to be stored in various specific log files. See the syslog-ng documentation for how to do this.
====Software to help analyse logged messages====
There are many packages to do this, my personal favourite is [http://www.splunk.com/ Splunk!]. For home type use it is free. Splunk is very powerful and can also turn your PC into a SysLog Server (if your PC is on 24/7 then consider using splunk! for all your needs rather than using your NAS as the SysLog Server). Whether your PC or your NAS is the SysLog server, Splunk! provides very comprehensive filtering and analysis tools for analysing SysLog data.


==Assumptions==
==Assumptions==
Line 40: Line 27:


==Overview of the Modification==
==Overview of the Modification==
'''NOTE: The Syslog-ng binary is included with DSM 3.0 (FW 1337). If you have DSM 3.0 you can skip the installation of ipkg and syslog-ng below, see this wiki's discussion page for more information'''
# Create a shared folder on your NAS called "logs" to store the received system log messages
# Create a shared folder on your NAS called "logs" to store the received system log messages
# Install ipkg if you have not previously installed it
# Install ipkg if you have not previously installed it
Line 50: Line 36:


==The Process==
==The Process==
'''NOTE: The Syslog-ng binary is included with DSM 3.0 (FW 1337). If you have DSM 3.0 you can skip the installation of ipkg and syslog-ng below, see this wiki's discussion page for more information'''
#Using an internet browser login to the Management webpage of your NAS as "admin"
#Using an internet browser login to the Management webpage of your NAS as "admin"
#Create a shared folder called "logs" on volume1. You can place it on another volume if you want but from now on I will assume it is on volume1
#Create a shared folder called "logs" on volume1. You can place it on another volume if you want but from now on I will assume it is on volume1
Line 71: Line 56:
Below is the code to be copied and pasted into the file "/opt/etc/syslog-ng/syslog-ng.conf". All other lines in the file (i.e. all except those below) should be commented out, i.e. put a "#" at the start of each line.
Below is the code to be copied and pasted into the file "/opt/etc/syslog-ng/syslog-ng.conf". All other lines in the file (i.e. all except those below) should be commented out, i.e. put a "#" at the start of each line.


The code below tells syslog-ng to monitor port 49152 for UDP packets, this port should be free unless you have already configured that port for something else. If you want to use another port you can change it but do not attempt to use port 514 as it is disabled by the internal syslogd. Also if the device sending the Syslog data only supports TCP packets then you may need to change that, see this wiki's discussion page for more info.
The code below tells syslog-ng to monitor port 49152, this should be free unless you have already configured that port for something else. If you want to use another port you can change it but do not attempt to use port 514 as it is disabled by the internal syslogd.
 
The log files created by the code below will have the "owner" file permission set to "root", if for scripting reasons you need the log files to belong to specific owners/groups, how to control this is also stated on this wiki's discussion page.


The code below tells syslog-ng to create a new file for storing log messages every day, you can change the log file name if required, but beware of using a static name as the log file can grow too large if you do not have some method of clearing/rotating it.
The code below tells syslog-ng to create a new file for storing log messages every day, you can change the log file name if required, but beware of using a static name as the log file can grow too large if you do not have some method of clearing/rotating it.
Line 95: Line 78:
#When ipkg has finished uninstalling syslog-ng close the [[Modifications|Command Line Interface]] session.
#When ipkg has finished uninstalling syslog-ng close the [[Modifications|Command Line Interface]] session.
#If you want too you can delete the files in the shared folder "logs" and then use the Management web page to remove the "logs" shared folder that you created.
#If you want too you can delete the files in the shared folder "logs" and then use the Management web page to remove the "logs" shared folder that you created.
[[Category:SynologyWiki]]
[[Category:ToBeExported]]
Please note that all contributions to wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wiki:Copyrights for details). Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)