Syslog Server ! :-)

A DSM update includes Directory Server, LDAP Client, Remote Folder, Virtual Drive, Syslog Server, Mac OS X Lion Support, Photo Station 5, Google Cloud Print, UPnP Router Support, DSM mobile, CalDAV server, and along with other software enhancements.
Forum rules
1) This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:

https://account.synology.com/support/su ... p?lang=enu



2) To avoid putting users' DiskStation at risk, please don't paste links to any patches provided by our Support team as we will systematically remove them. Our Support team will provide the correct patch for your DiskStation model.
dahlb
Trainee
Trainee
Posts: 10
Joined: Tue Sep 13, 2011 12:43 am

Re: Syslog Server ! :-)

Unread post by dahlb » Thu Oct 13, 2011 1:00 am

2 FYI

1) you don't have to restart the synology just run /volume1/@appstore/SyslogServer/scripts/runscript.sh restart

2) if you get a bunch of emails your don't care about you can filter the mailed log entries by editing
/volume1/@appstore/SyslogServer/etc/template/filter_prior_mail.template
mine is
filter f_syno_mail {
level(_SYNO_PRIORITY_) and not program("synoautoblock|synoindexd|dhcpcd|ntpdate|hp");
};

User avatar
sjeph8je
Seasoned
Seasoned
Posts: 551
Joined: Fri Jan 29, 2010 10:06 pm
Location: Netherlands

Re: Syslog Server ! :-)

Unread post by sjeph8je » Sat Mar 10, 2012 3:04 pm

After the update to DSM 4.0, this seems to be changed. I have made the same changes to the system files, and nothing is showing up in the syslog server.

Anybody else experiencing this?
DS-218+ (10GB) | DSM 6.2-23739 | 1 x WD20EFRX (Basic-btrfs) (Hyper backup vault, DS, Docker, Tvheadend)
DS-916+ (8GB) | DSM 6.2-23739 | 2 x WD40EFRX (RAID1-btrfs) | 2 x WD10EFRX (RAID1-btrfs) (AS, Calendar, Chat, CMS, Docker, Hyper backup, PS, Snapshot Replication, SVN, VS, WS, Webdav)
  • Startech S3510SMU33 | WD20EFRX (ext-4)
DS-213J | DSM 6.2-23739 | 1 x WD20EFRX (Basic-ext4) (Hyper backup vault)
DS-209 | DSM 6.2-23648

Corruption wears infinite disguises.

User avatar
CoolRaoul
Seasoned
Seasoned
Posts: 560
Joined: Tue May 18, 2010 7:08 pm

Re: Syslog Server ! :-)

Unread post by CoolRaoul » Sat Mar 10, 2012 5:29 pm

sjeph8je wrote:After the update to DSM 4.0, this seems to be changed. I have made the same changes to the system files, and nothing is showing up in the syslog server.

Anybody else experiencing this?
I Think that with DSM 4 you do not need to change the system files for this.

Just enable "syslog client", in control panel and set server to localhost or 127.0.0.1
CR

User avatar
sjeph8je
Seasoned
Seasoned
Posts: 551
Joined: Fri Jan 29, 2010 10:06 pm
Location: Netherlands

Re: Syslog Server ! :-)

Unread post by sjeph8je » Sat Mar 10, 2012 5:44 pm

Hi,

I've seen this option and it looks promising but one thing that is not available is sending the log items from the /var/log/messages to the syslog server. With the change mentioned to the system file these messages could be added to the syslog server. These messages also contained far more detail than in the /var/log/messages file.

Synology somehow came up with a way to break this, perhaps someone with more linux background can shed some light?
DS-218+ (10GB) | DSM 6.2-23739 | 1 x WD20EFRX (Basic-btrfs) (Hyper backup vault, DS, Docker, Tvheadend)
DS-916+ (8GB) | DSM 6.2-23739 | 2 x WD40EFRX (RAID1-btrfs) | 2 x WD10EFRX (RAID1-btrfs) (AS, Calendar, Chat, CMS, Docker, Hyper backup, PS, Snapshot Replication, SVN, VS, WS, Webdav)
  • Startech S3510SMU33 | WD20EFRX (ext-4)
DS-213J | DSM 6.2-23739 | 1 x WD20EFRX (Basic-ext4) (Hyper backup vault)
DS-209 | DSM 6.2-23648

Corruption wears infinite disguises.

User avatar
CoolRaoul
Seasoned
Seasoned
Posts: 560
Joined: Tue May 18, 2010 7:08 pm

Re: Syslog Server ! :-)

Unread post by CoolRaoul » Sat Mar 10, 2012 5:56 pm

Oh, you're right

In fact I think there a great amount of bugs remaining in syslog subsystem on 4.0,

one example:

Code: Select all

FSERV> /usr/syno/etc/rc.d/S22syslogng.sh start
Syslog-ng server start...
sh: or: unknown operand
sh: or: unknown operand
sh: or: unknown operand
sh: or: unknown operand
sh: or: unknown operand
sh: or: unknown operand
sh: or: unknown operand
The bug is inside the script "/usr/syno/syslogclient/scripts/runscript.sh"

Code: Select all

    	if [ -n "${fac}" ]; then
    	    if [ -z ${SYSLOGNG_FAC_FILTER_STRING} ]; then
    		    SYSLOGNG_FAC_FILTER_STRING="program(${fac})"
    	    else
    		    SYSLOGNG_FAC_FILTER_STRING="${SYSLOGNG_FAC_FILTER_STRING} or program(${fac})"
    	    fi
    	fi
There should be quotes around "${SYSLOGNG_FAC_FILTER_STRING}", like this

Code: Select all

    	    if [ -z "${SYSLOGNG_FAC_FILTER_STRING}" ]; then
Another one, inside the file "/usr/syno/etc/rc.d/S22syslogng.sh":

Code: Select all

        if [ "yes" == SYSLOGNG_SERVER_ENABLE ]; then
            #When booting, leave this action for real run script if server is enable
            echo "Leave start action for server run script"
            exit;
        fi
the "if" test is always false because the "$" has been forgotten, should have been:

Code: Select all

        if [ "yes" == $SYSLOGNG_SERVER_ENABLE ]; then

and the value of that variable comes from the code:

[code]    SYSLOGNG_SERVER_ENABLE=`/bin/get_key_value ${FILE_SYSLOGNG_SETTING} server_enable`
but the value of "FILE_SYSLOGNG_SETTING" is "/usr/syno/etc/synosyslog/setting.conf" which *does not exists*!

Do you think synology dev team eople is already aware of those problems?
Last edited by CoolRaoul on Sat Mar 10, 2012 7:43 pm, edited 1 time in total.
CR

User avatar
maxxfi
Compiler
Compiler
Posts: 6794
Joined: Sun Dec 27, 2009 12:13 pm
Location: Espoo, Finland

Re: Syslog Server ! :-)

Unread post by maxxfi » Sat Mar 10, 2012 7:03 pm

CoolRaoul wrote:Oh, you're right

In fact I think there a great amount of bugs remaining in syslog subsystem on 4.0,
(Oh, great... :( )
Do you think synology dev team eople is already aware of those problems?
Well, I suggest that you file a bug about those issues anyway
No longer using Synology NAS, moved to more open source solutions.
DS-106j > DS-210j > DS-411

User avatar
sjeph8je
Seasoned
Seasoned
Posts: 551
Joined: Fri Jan 29, 2010 10:06 pm
Location: Netherlands

Re: Syslog Server ! :-)

Unread post by sjeph8je » Sat Mar 10, 2012 7:34 pm

Yeah,

I think so too, keep us informed if you do :wink:

User avatar
CoolRaoul
Seasoned
Seasoned
Posts: 560
Joined: Tue May 18, 2010 7:08 pm

Re: Syslog Server ! :-)

Unread post by CoolRaoul » Sat Mar 10, 2012 7:44 pm

sjeph8je wrote:Yeah,

I think so too, keep us informed if you do :wink:
Done

stay tuned;
CR

User avatar
CoolRaoul
Seasoned
Seasoned
Posts: 560
Joined: Tue May 18, 2010 7:08 pm

Re: Syslog Server ! :-)

Unread post by CoolRaoul » Sun Mar 11, 2012 1:44 pm

another bug found:

Code: Select all

$ /usr/local/etc/rc.d/SyslogServer.sh start
sh: 1: unknown operand
sh: 1: unknown operand
sh: 1: unknown operand
sh: 1: unknown operand
sh: 2197: unknown operand
Explanation:
inside the script there is the following line

Code: Select all

PACKAGE_LIMIT=`get_key_value ${DSM_CONFIG} ${PACKAGE_LIMIT_KEY}`
"get_key_value" returns an empty string, because the value of PACKAGE_LIMIT_KEY (currently "synosyslog_limit") is not present in /etc.defaults/synoinfo.conf (value of ${DSM_CONFIG})

New support ticket opened :roll:
CR

User avatar
CoolRaoul
Seasoned
Seasoned
Posts: 560
Joined: Tue May 18, 2010 7:08 pm

Re: Syslog Server ! :-)

Unread post by CoolRaoul » Mon Mar 12, 2012 10:04 am

No answer from support yet, but I've been able to found a working configuration.

Fisrt apply the following fixes:
  • File: "/usr/syno/etc/rc.d/S22syslogng.sh"

    Code: Select all

    -- FILE_SYSLOGNG_SETTING=/usr/syno/etc/synosyslog/setting.conf
    ++ FILE_SYSLOGNG_SETTING=/etc/synosyslog.conf
    
    and

    Code: Select all

    -- if [ "yes" == SYSLOGNG_SERVER_ENABLE ]; then        
    ++ if [ "yes" == $SYSLOGNG_SERVER_ENABLE ]; then
  • File: "/usr/syno/syslogclient/scripts/runscript.sh"

    Code: Select all

    -- if [ -z ${SYSLOGNG_FAC_FILTER_STRING} ]; then
    ++ if [ -z "${SYSLOGNG_FAC_FILTER_STRING}" ]; then
    
  • File: "/usr/local/etc/rc.d/SyslogServer.sh"
    The errors can by ignored.
Then, add those lines at the end of "/usr/syno/syslogclient/etc/system.conf":

Code: Select all

source s_system_local { unix-stream("/var/run/log"); };
log { source(s_system_local);  filter(f_syno_client_sev); destination(d_syno_internet); flags(flow_control); };

Syslog server and client have to be restarted
Since I'm unable to garantee the correct order of operations, I think the best is simply to restart the Synology
Last edited by CoolRaoul on Mon Mar 12, 2012 2:30 pm, edited 3 times in total.
CR

User avatar
sjeph8je
Seasoned
Seasoned
Posts: 551
Joined: Fri Jan 29, 2010 10:06 pm
Location: Netherlands

Re: Syslog Server ! :-)

Unread post by sjeph8je » Mon Mar 12, 2012 11:33 am

Thanks for the good work,

Will try later today, as I have no way of doing it now, will let you know how it works out :)

Hope Synology will fix this soon.

Best regards,
DS-218+ (10GB) | DSM 6.2-23739 | 1 x WD20EFRX (Basic-btrfs) (Hyper backup vault, DS, Docker, Tvheadend)
DS-916+ (8GB) | DSM 6.2-23739 | 2 x WD40EFRX (RAID1-btrfs) | 2 x WD10EFRX (RAID1-btrfs) (AS, Calendar, Chat, CMS, Docker, Hyper backup, PS, Snapshot Replication, SVN, VS, WS, Webdav)
  • Startech S3510SMU33 | WD20EFRX (ext-4)
DS-213J | DSM 6.2-23739 | 1 x WD20EFRX (Basic-ext4) (Hyper backup vault)
DS-209 | DSM 6.2-23648

Corruption wears infinite disguises.

Locked

Return to “DiskStation Manager 3.2 BETA - 1869”