This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!



I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!

allow syslog settings to be adjusted

Post/Debate your Suggestions & Requests of XigmaNAS here. This ONLY pertains to XigmaNAS.
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
jamaroney
Advanced User
Advanced User
Posts: 245
Joined: 13 Aug 2012 17:32
Location: Stroudsburg, PA
Status: Offline

allow syslog settings to be adjusted

Post by jamaroney »

I was trying to set up N4F as a syslog server via https://www.jmedved.com/2014/03/nas4fre ... og-server/.

But with an embedded install, there's a lot of limitations. The server option is disabled by default, and I can't edit syslog.conf, /etc/rc.d/clog, nor /etc/rc.d/syslogd.

Is there something I'm missing (other than going with a full install)? If not, options should be in place to adjust setting within these files.

Snunn1
Starter
Starter
Posts: 35
Joined: 05 Sep 2013 21:55
Status: Offline

Re: allow syslog settings to be adjusted

Post by Snunn1 »

Just as the link you've provided explains, I've used a PostInit command using sed on Embedded to forward my syslogs to my Logstash jail. You could do the same to specify an alternative syslog.conf which is then configured with the logs you're interested in.
NAS4Free 10.2.0.2.2545 P14 Embedded on 1GB USB Key
HP N40L Microserver - 8GB ECC RAM, 3x Seagate 500GB RAIDZ1, 1x Seagate 500GB UFS & 1x 200GB SATA
Extensions: RRDGraphs

jamaroney
Advanced User
Advanced User
Posts: 245
Joined: 13 Aug 2012 17:32
Location: Stroudsburg, PA
Status: Offline

Re: allow syslog settings to be adjusted

Post by jamaroney »

Snunn1 wrote:You could do the same to specify an alternative syslog.conf....
Thanks - how do I specify an alternative conf file?

Snunn1 wrote:.....which is then configured with the logs you're interested in.
How do I configure my router's log messages to go into their own separate file? Right now, they all go into N4F's system.log.

Snunn1
Starter
Starter
Posts: 35
Joined: 05 Sep 2013 21:55
Status: Offline

Re: allow syslog settings to be adjusted

Post by Snunn1 »

jamaroney wrote:
Snunn1 wrote:You could do the same to specify an alternative syslog.conf....
Thanks - how do I specify an alternative conf file?
-f config file - see HERE for the man pages.
jamaroney wrote:
Snunn1 wrote:.....which is then configured with the logs you're interested in.
How do I configure my router's log messages to go into their own separate file? Right now, they all go into N4F's system.log.
This can be configured in syslog.conf - see the man pages on the link above.

Hope this Helps
NAS4Free 10.2.0.2.2545 P14 Embedded on 1GB USB Key
HP N40L Microserver - 8GB ECC RAM, 3x Seagate 500GB RAIDZ1, 1x Seagate 500GB UFS & 1x 200GB SATA
Extensions: RRDGraphs

jamaroney
Advanced User
Advanced User
Posts: 245
Joined: 13 Aug 2012 17:32
Location: Stroudsburg, PA
Status: Offline

Re: allow syslog settings to be adjusted

Post by jamaroney »

After reading that page, what I still don't understand is how a specific network device's logs can be directed to a separate file.

With my embedded install, via a N4F WEBGUI PostInit command, I use the following to have all my router's messages sent to N4F with an alternative syslog.conf

sed -i -e 's^syslogd_flags=".*"^syslogd_flags="-8 -a 192.168.1.1/24:*"^g' /etc/rc.d/syslogd ; /etc/rc.d/syslogd restart -f /mnt/HDD/syslog.conf

What this yields is both router and N4F messages going into the system.log file.

But I want all router messages to go only to its own file (e.g., router.log). All the instructions I see on the page you noted (as well as other places on the web) show how to channel TYPES of messages to different logs, but not how to channel different devices to separate logs.

So, what do I need to enter into the new syslog.conf to have my router (192.168.1.1) messages go to router.log (and nowhere else)?

Snunn1
Starter
Starter
Posts: 35
Joined: 05 Sep 2013 21:55
Status: Offline

Re: allow syslog settings to be adjusted

Post by Snunn1 »

I've got some notes on setting this up so I'll send you a PM about this as soon as I've found them. Once we've solved it, I'll add the solution to this thread.
NAS4Free 10.2.0.2.2545 P14 Embedded on 1GB USB Key
HP N40L Microserver - 8GB ECC RAM, 3x Seagate 500GB RAIDZ1, 1x Seagate 500GB UFS & 1x 200GB SATA
Extensions: RRDGraphs

jamaroney
Advanced User
Advanced User
Posts: 245
Joined: 13 Aug 2012 17:32
Location: Stroudsburg, PA
Status: Offline

Re: allow syslog settings to be adjusted

Post by jamaroney »

Thanks so much!

jamaroney
Advanced User
Advanced User
Posts: 245
Joined: 13 Aug 2012 17:32
Location: Stroudsburg, PA
Status: Offline

Re: allow syslog settings to be adjusted

Post by jamaroney »

I solved the problem via the router. It has dd-wrt firmware, so I enabled a CIFS share for it on one of my N4F drives, and commanded the router's syslogd to output its log file there.

Snunn1
Starter
Starter
Posts: 35
Joined: 05 Sep 2013 21:55
Status: Offline

Re: allow syslog settings to be adjusted

Post by Snunn1 »

Glad you found a workaround but it's a pity syslogd on N4F couldn't do it. I've tested syslogd recently using iceflatline's article HERE but syslogd bombs out with...

Code: Select all

nas4free: ~ # /usr/sbin/syslogd -a 192.168.1.1/24 -f /mnt/Data/syslog.conf
syslogd: child pid 47679 exited on signal 11
...when I try it using it with the following config (Netgear is in /etc/hosts):

Code: Select all

nas4free: ~ # cat /mnt/Data/syslog.conf
local3.* %/var/log/sshd.log
local4.* %/var/log/rsyncd.log
local5.* %/var/log/smartd.log
ftp.* %/var/log/ftp.log
daemon.* %/var/log/daemon.log
*.notice;kern.debug;lpr.info;mail.crit;mail.info;news.err;local0.none;local7.none %/var/log/system.log
security.* %/var/log/system.log
auth.info;authpriv.info %/var/log/system.log
*.emerg *
+Netgear
*.* %/var/log/router.log
If I change the last line to *.* /var/log/router.log, syslogd executes but nothing relating to Netgear gets written to router.log or to system.log - the messages seem to vanish. Any ideas anyone?

Thanks
Snunn1
NAS4Free 10.2.0.2.2545 P14 Embedded on 1GB USB Key
HP N40L Microserver - 8GB ECC RAM, 3x Seagate 500GB RAIDZ1, 1x Seagate 500GB UFS & 1x 200GB SATA
Extensions: RRDGraphs

kfnas
Starter
Starter
Posts: 65
Joined: 06 Mar 2014 18:41
Status: Offline

Re: allow syslog settings to be adjusted

Post by kfnas »

where in 9.3.0.2 - Nayla (revision 1283) is (embedded) the syslog (remote) config yet please? I have upgraded it from previous 9.2. version and at least the forwarding is in config(xml) but can't see it under system general anymore...
I would like to modify it and to set the local facility so I can track it on the remote syslog

Snunn1
Starter
Starter
Posts: 35
Joined: 05 Sep 2013 21:55
Status: Offline

Re: allow syslog settings to be adjusted

Post by Snunn1 »

If you look in /etc/rc.d/syslogd, you'll see that it echos to /etc/syslog.conf. If you add anything to this inbetween the quotation marks after the echo, it will be copied into syslog.conf.

Hope this Helps
Snunn1
NAS4Free 10.2.0.2.2545 P14 Embedded on 1GB USB Key
HP N40L Microserver - 8GB ECC RAM, 3x Seagate 500GB RAIDZ1, 1x Seagate 500GB UFS & 1x 200GB SATA
Extensions: RRDGraphs

Snunn1
Starter
Starter
Posts: 35
Joined: 05 Sep 2013 21:55
Status: Offline

Re: allow syslog settings to be adjusted

Post by Snunn1 »

After following the steps HERE to allow N4F to create a new logfile for my router, the router syslog messages get written to system.log as well as router.log. Does anyone know how to only permit messages to be written to router.log?

Thanks
Snunn1
NAS4Free 10.2.0.2.2545 P14 Embedded on 1GB USB Key
HP N40L Microserver - 8GB ECC RAM, 3x Seagate 500GB RAIDZ1, 1x Seagate 500GB UFS & 1x 200GB SATA
Extensions: RRDGraphs

piwwo
Starter
Starter
Posts: 27
Joined: 21 Mar 2013 15:30
Status: Offline

Re: allow syslog settings to be adjusted

Post by piwwo »

I am struggling with a similar problem: I need syslog messages from a chroot environment but can't get it to work. According to this http://www.the-art-of-web.com/system/sf ... ng-chroot/ I have to set dev/log sockets in the chroot environment and edit syslog.conf. But that post is for rsyslog and linux, not BSD. Has anyone solved this?
viewforum.php?f=57

Post Reply

Return to “Suggestions & Requests”