However I have tried to reduce writing log events to the SD card and instead sending them to my NAS.
You need to edit a few text files. I'm used to emacs and have installed that. You can use whichever editor that you feel comfortable with.
This is what I did:
- Set the host name of the Raspberry Pi to something unique. This is the host name that will show up for each log on the NAS.
$ sudo emacs /etc/hostname
Replace raspberrypi with the host name you would like to use. Save the file and exit the editor.
- Then open the next file:
$ sudo emacs /etc/hosts
Replace all instancied of raspberrypi with the new host name. Save the file and exit the editor. -
You have to restart a process or reboot your Raspberry Pi. To restart process type
$ sudo /etc/init.d/hostname.sh start
-
To redirect all syslog logs to a NAS open the syslog config file:
$ sudo emacs /etc/rsyslog.conf
Under the RULES sections add the following line:*.* @11.22.33.44
You need to change 11.22.33.44 with the IP number to your NAS server.
Then you have to comment out all log directives to log files by setting a # before each row.
Save the file and exit the editor. -
Now you need to restart the rsyslog daemon mto make it reread the config file:
$ sudo service rsyslog restart
Now you can watch the logs come to your NAS instead of to the SD card.
No comments:
Post a Comment