Difference between revisions of "Syslog"

From Bashlinux
Jump to: navigation, search
(syslog)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
= syslog =
 
 
== How to enable remote logs come in from remote hosts in Fedora ==
 
== How to enable remote logs come in from remote hosts in Fedora ==
 
Useful from small embedded devides like routers, DSL modems and access points.
 
Useful from small embedded devides like routers, DSL modems and access points.

Revision as of 07:41, 28 February 2015

How to enable remote logs come in from remote hosts in Fedora

Useful from small embedded devides like routers, DSL modems and access points.

1. Enable UDP syslog reception in `/etc/rsyslog.conf` and uncomment the following lines:

 $ModLoad imudp
 $UDPServerRun 514
 
Ensure TCP syslog is either disabled or running on a different port.

1. Restart rsyslog:

 systemctl restart rsyslog.service
 


  1. In OpenWRT UI go to System tab, System subtab, Logging sub-subtab. Put the IP of the Fedora server there. Web-based UI in Backfire is powerful and easy to use, but you can confirm that the changes are saved in `/etc/config/system` as option 'log_ip' '192.168.m.n'
  2. Here you need to restart syslogd on the router. I admit, I couldn't figure out how to do that mad so I ended up just rebooting the router. Whatever you do, your ps output should show syslogd -R 192.168.m.n:514 (maybe some other switches like -C or -L).
  3. Now look in `/var/log/messages` on Fedora server. You should see messages from the router. If your router is not busy, try to log in or log out - it should get recorded. You will also see the name that the router reports to syslog
  4. if you want to combine router-based messages into single file, follow the advice from diego.misc above: Create the file `etc/rsyslogd.d/openwrt.conf` with the following contents:
 :source, isequal, "server.ip" /var/log/mylogfile.log
 :source, isequal, "server.ip" ~