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.

Re: Syslog Server ! :-)

Postby 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");
};
dahlb
I'm New!
I'm New!
 
Posts: 4
Joined: Tue Sep 13, 2011 12:43 am

Re: Syslog Server ! :-)

Postby 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?
Synology DS-209 | DSM 4.1-2668 | 2 x WD20EARS (RAID1) (Time Backup | PhpMyAdmin | PhpLdapAdmin | PhpPgAdmin | Mailstation 2 | Svn | Directory server | Syslog server)
  • USB Conceptronic CHD3SU | WD20EARS (Ext-4)
Synology DS-209 | DSM 4.2-3202 | 2 x WD5000AAKS (RAID0) (syslog server)
  • USB Conceptronic CHD3NET | WD5000AAVS (Ext-4)
Corruption wears infinite disguises.
User avatar
sjeph8je
Knowledgeable
Knowledgeable
 
Posts: 324
Joined: Fri Jan 29, 2010 10:06 pm
Location: Netherlands

Re: Syslog Server ! :-)

Postby 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
CoolRaoul
Sharp
Sharp
 
Posts: 162
Joined: Tue May 18, 2010 7:08 pm

Re: Syslog Server ! :-)

Postby 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?
Synology DS-209 | DSM 4.1-2668 | 2 x WD20EARS (RAID1) (Time Backup | PhpMyAdmin | PhpLdapAdmin | PhpPgAdmin | Mailstation 2 | Svn | Directory server | Syslog server)
  • USB Conceptronic CHD3SU | WD20EARS (Ext-4)
Synology DS-209 | DSM 4.2-3202 | 2 x WD5000AAKS (RAID0) (syslog server)
  • USB Conceptronic CHD3NET | WD5000AAVS (Ext-4)
Corruption wears infinite disguises.
User avatar
sjeph8je
Knowledgeable
Knowledgeable
 
Posts: 324
Joined: Fri Jan 29, 2010 10:06 pm
Location: Netherlands

Re: Syslog Server ! :-)

Postby 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
CoolRaoul
Sharp
Sharp
 
Posts: 162
Joined: Tue May 18, 2010 7:08 pm

Re: Syslog Server ! :-)

Postby 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
DS-411 (DSM 4.2-3202) w/ 2x WD10EFRX + 1x HD154UI
DS-106j (DSM 3.0-1357), PATA-to-SATA adapter, 2.5" HM250HI
User avatar
maxxfi
Architect
Architect
 
Posts: 4317
Joined: Sun Dec 27, 2009 12:13 pm
Location: Espoo, Finland

Re: Syslog Server ! :-)

Postby sjeph8je » Sat Mar 10, 2012 7:34 pm

Yeah,

I think so too, keep us informed if you do :wink:
User avatar
sjeph8je
Knowledgeable
Knowledgeable
 
Posts: 324
Joined: Fri Jan 29, 2010 10:06 pm
Location: Netherlands

Re: Syslog Server ! :-)

Postby 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
CoolRaoul
Sharp
Sharp
 
Posts: 162
Joined: Tue May 18, 2010 7:08 pm

Re: Syslog Server ! :-)

Postby 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
CoolRaoul
Sharp
Sharp
 
Posts: 162
Joined: Tue May 18, 2010 7:08 pm

Re: Syslog Server ! :-)

Postby 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
CoolRaoul
Sharp
Sharp
 
Posts: 162
Joined: Tue May 18, 2010 7:08 pm

Re: Syslog Server ! :-)

Postby 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,
Synology DS-209 | DSM 4.1-2668 | 2 x WD20EARS (RAID1) (Time Backup | PhpMyAdmin | PhpLdapAdmin | PhpPgAdmin | Mailstation 2 | Svn | Directory server | Syslog server)
  • USB Conceptronic CHD3SU | WD20EARS (Ext-4)
Synology DS-209 | DSM 4.2-3202 | 2 x WD5000AAKS (RAID0) (syslog server)
  • USB Conceptronic CHD3NET | WD5000AAVS (Ext-4)
Corruption wears infinite disguises.
User avatar
sjeph8je
Knowledgeable
Knowledgeable
 
Posts: 324
Joined: Fri Jan 29, 2010 10:06 pm
Location: Netherlands

Previous

Return to DiskStation Manager 3.2 BETA - 1869

Who is online

Users browsing this forum: pure_energy1 and 2 guests