Tuesday, December 28, 2010

System Configuration and Management -- Configure a system to accept logging from a remote system

In prior releases of redhat, remote logging was configured via syslogd. In RHEL6, this is replaced with rsyslog.

The first step is to setup a remote server to receive the logging messages, http://www.rsyslog.com/receiving-messages-from-a-remote-system/ has a great walkthrough on setting this up.
  1. Edit /etc/rsyslog.conf an clear the # before the lines allowing syslog reception
    1. $ModLoad imudp.so
    2. $UDPServerRun 514
    3. $ModLoad imtcp.so
    4. $InputTCPServerRUN 514
  2. Restart the rsyslog daemon - service rsyslog restart
  3. Open the firewall to allow syslog connections
    1. iptables -I INPUT -p tcp --dport 514 -j ACCEPT
    2. iptables -I INPUT -p udp --dport 514 -j ACCEPT
    3. iptables-save > /etc/sysconfig/iptables
The next step is to configure the local system to send messages, http://www.rsyslog.com/sending-messages-to-a-remote-syslog-server/ has a great walkthrough on setting this up
  1. Edit /etc/rsyslog.conf and enter the below line (using the appropriate IP or DNS name)
    1. *.*   @@
  2. Restart the rsyslog daemon - service rsyslog restart
Test the configuration by running logger -p warn foo. This will log a message in the local /var/log/messages and should log a similar message at the same location on the remote server


Anonymous said...

Hi, do you have any information on "Build a simple RPM that packages a single file"?
I plan on taking the RHCE exam this month.

edgoad said...

Not yet. I have found several sites discussing how to create RPM packages, but they are all focused on installing programs - not packaging individual files.

Anonymous said...

On building packages see this: