Search code examples
macosudproutersyslog

How to enable syslogd to receive UDP logs from routers in OSX


Occasionally a router goes bad and I would like to get the router logs.

While some routers have built-in log viewers, some do not. Most routers seem to have a facility to send logs to another host using syslog.

How do I get OSX (client) to receive these logs? OSX has a syslogd, but the instructions are opaque at best.

Perhaps a different client application would be better, but I'd prefer a way I could just hack up without downloading tools across the internet that has just broken down...

OSX does not have netcat, natively, otherwise I would have tried that.


Solution

  • Using syslog-ng which is probably available for OS X, although I am not certain, I capture syslog messages over my home network from my wifi router to my log server with the following 3 lines:

     source net { udp(); };
    
     destination wifirouter { file("/opt/var/log/wifirouter.log"); };
    
     log { source(net); destination(wifirouter); };
    

    The wifi router was then configured to use use the log server's IP address and the wifirouter identifier. You could modify the source line to accept from only certain source IP addresses.