Syslog redirection to syslog server?


Recommended Posts

Anyone tried redirecting the syslog of unRAID to an external syslog server, say over UDP 514? Thanks!

 

Works fine.

 

This is one of my startup scripts.

#!/bin/bash
cp /boot/custom/etc/syslog.conf /etc/syslog.conf
read PID < /var/run/syslogd.pid
kill -1 ${PID}
dmesg | logger -tdmesg -plocal7.info -i

 

This is my /boot/custom/etc/syslog.conf file.

# /etc/syslog.conf
#
# Facilities: auth, authpriv, cron, daemon, kern, lpr, mail, mark,
# news, security (same as auth), syslog, user, uucp, local0 thru local7.

# Here are the priorities in descending order:
# emerg, panic
# alert
# crit
# err, error              <= samba debug level 0
# warnning, warn          <= samba debug level 1
# notice                  <= samba debug level 2
# info                    <= samba debug level 3
# debug                   <= sambe debug level 4+

# Everything to syslog:
*.*                                                     -/var/log/syslog
*.*                                                     -/dev/tty12
*.*                                                     [email protected]


# Emergency level messages go to all users:
*.emerg                                                 *

 

use an IP address instead of hostname just in case name resolution is not working.

I also put the output to /dev/tty12 so the machine's last few messages can be watched in a pinch.

 

Link to comment
  • 8 months later...
  • 1 month later...

Wanted to update that this works perfectly. Thanks Weebo! :)

One sysloglog entry after the reboot was this:

Tower dmesg[4172]: process `syslogd' is using obsolete setsockopt SO_BSDCOMPAT

 

A little google search found it is a result of syslogd uses an obsolete socket option in 2.6.xx - but still works..

 

syslogd is using obsolete setsockopt so_bsdcompat

process `syslogd' is using obsolete setsockopt SO_BSDCOMPAT

The sysklogd package uses a socket option which still works in 2.6 but is deprecated. This package hasn't been updated yet (you can check here). You can ignore the message, or install the alternative syslog-ng package.

 

which is corrected with syslog 1.5.1

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=201231

Source: sysklogd

Source-Version: 1.5-1

 

We believe that the bug you reported is fixed in the latest version of

sysklogd...

 

Attached the output from my unRAID server to the Synology.  Very nice since I have remote access to the Synology...I can keep track of the unRAID at all times! 8)... ;D

 

Does 5.0BetaX use syslog 1.5-1?

 

I did find a way to install syslog-ng...but I'm not that skilled to not make my unRAID fubar.

http://www.linuxquestions.org/questions/slackware-14/syslog-ng-instead-of-syslog-638619/

 

Also get email messages from Synology..sweet!

Dear user,

 

There are some system logs reached on DiskStation. Please check out the details on the system.

The content of logs are as follows:

Host: '192.168.1.108', IP: '192.168.1.108', Level: 'err', Date: '2011-08-31', Time: '20:19:19', Program: 'mountd', Message: 'Caught signal 15, un-registering and exiting.'

 

Sincerely,

Synology DiskStation

.

03_Aug._31_20_20.jpg.d98577ec39a7f8dfb64a22bab90678de.jpg

Link to comment
  • 5 months later...

Hello,

 

I want to forward my syslog to IP 10.0.1.21 on UDP 514 - but reading this I am not totally clear on the steps.

 

Do I create a startup script like weebotech?

 

#!/bin/bash

cp /boot/custom/etc/syslog.conf /etc/syslog.conf

read PID < /var/run/syslogd.pid

kill -1 ${PID}

dmesg | logger -tdmesg -plocal7.info -i

 

I can't see how this sends data to another IP? I think i am missing something?

 

Jon

Link to comment

Hello,

 

I want to forward my syslog to IP 10.0.1.21 on UDP 514 - but reading this I am not totally clear on the steps.

 

Do I create a startup script like weebotech?

 

#!/bin/bash

cp /boot/custom/etc/syslog.conf /etc/syslog.conf

read PID < /var/run/syslogd.pid

kill -1 ${PID}

dmesg | logger -tdmesg -plocal7.info -i

 

I can't see how this sends data to another IP? I think i am missing something?

 

Jon

 

The IP address is in syslod.conf

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.