Wednesday 22 June 2011

Configure a system to log to a remote system

I sometimes wonder about Red Hat. This objective is meaningless without the next objective, Configure a system to accept logging from a remote system, so why just not combine them? I guess that if they did that, it would cut down in the number of objectives and make the exam look too easy, who knows?

At any rate, provided that you have achieved the next objective [sic] this one should be very easy to achieve. You need to edit the /etc/rsyslog.conf file and add the following line at the end of it:
*.* @@10.168.20.233:514
The above assumes that you want to log everything to a server on 10.168.20.233 on port 514. It is of course possible to simply log a category, e.g. mail, cron, authentication, etc.. Use the next line to log authentication to the same server:
authpriv.*                                            @@10.168.20.233:514
All that remains is to restart the logging daemon:
service rsyslog restart
You can test that the system is logging to the remote server with:
logger "remote logger"
Incidentally, the logger command is very good for adding logging to bash scripting, so be sure to remember it.

No comments:

Post a Comment