[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4159
  • Last Modified:

log all freenas rsync activity to remote syslog

I run a file server utilizing Freenas 7. I have freenas sending logs to a remote syslog server. Freenas only sends RSYNC "start" "end" messages to the remote syslog. I would like it to send all the RSYNC activity including the file changes to the remote syslog. I imagine this would need to be done through the command line since the web interface doesn't contain an option for this (at least not that i see). Any ideas how I could accomplish this?
0
flyinace2
Asked:
flyinace2
  • 4
  • 3
  • 2
1 Solution
 
skullnobrainsCommented:
i assume FreeNAS loggs through syslog

read the syslog.conf man page

syslog can be instructed to send anything it receives to a remote syslog, possibly keeping a local copy

the config is performed in the usual way, based on the facility, priority, or syslog_name (usually the name of the process)

beware, you should probably check wether FreeNAS overwrites this file periodically. i consider it is unlikely
0
 
gheistCommented:
In rsyncd.conf

transfer logging = yes
syslog facility = local3

In syslog.conf

local5.* @loghost # loghost can be name or IP
0
 
flyinace2Author Commented:
Hi gheist, you seem to be on the right track, but do you know where I find "Rsyncd.conf"? I cant find it in the Freenas directory.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
skullnobrainsCommented:
should be in /usr/local/etc/ or possibly /usr/local/etc/rsync

if freenas performs the rsync over rlogin or ssh, you may not have an rsync daemon, in which case the server rsync is run on the server by the client, using the config file found in the user's home directory

but beware, it is very likely that freenas generates this file and will overwrite it either periodically or any time you use the admin interface which is why i suggested otherwise

----

it is also very unlikely that freenas itself does not provide a remote logging feature since it is built on top of monowall which as far as i remember can be instructed to do this

---

to do it using the syslog.conf file (located in /etc)

http://www.freebsd.org/cgi/man.cgi?query=syslog.conf&apropos=0&sektion=0&manpath=FreeBSD+8.2-RELEASE&arch=default&format=html

         A hostname (preceded by an at (``@'') sign).  Selected messages are
       forwarded to the syslogd(8) program on the named host.  If a port
       number is added after a colon (`:') then that port will be used as
       the destination port rather than the usual syslog port.

just find the line that corresponds to rsync and add @remote_host as gheist suggested

-----

you can probably also replace the syslog program itself with a proxy that will forward datagrams to the remote server, possibly over ssh or even using ssh itself for extra security but i would not recommend doing this unless you really know what you are doing, which means know network and freebsd admin basics, but also freenas
0
 
gheistCommented:
Freenas 6 not freenas 7

On a FreeBSD you find one in /usr/local/etc/ or /usr/local/etc/rsync/ or .../rsyncd

find / -type f -name rsync*conf -print # is another good try

0
 
gheistCommented:
PS i do use FreeBSD, Linux and other general purpose operating systems. They have manuals (man intro) for beginner and advanced admins, visual package managers (sysinstall) and other luxury like X11 one might enjoy.

PPS I would suggest you get your hands on virtualbox and recent release of freebsd (disk1 iso is enough tp install sysinstall which in turn allows to get rsync + manuals) to have manuals for production system around when they are needed

0
 
flyinace2Author Commented:
While all these suggestions seem very good, I can't find the rsync conf file anywhere on the Freenas 7 system. I even did a search in the file manager and it had no success...Any idea why or where else the rsync conf file might be hiding?
0
 
skullnobrainsCommented:
#> ps -auxww | grep rsync
either the config file is given on the command line, or it is in one of the locations specified in rsync manual page
0
 
skullnobrainsCommented:
i guess this could help when you need man pages

http://www.freebsd.org/cgi/man.cgi

concerning how to start with Freebsd, i'd recommend the handbook (type freebsd handbook in google) and "man hier"

beware that freenas is a heavily customised freebsd system

most customisations can be found on the monowall site since freenas is based on their work
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now