Logging with DD-WRT
From DD-WRT Wiki
Revision as of 13:28, 19 April 2008 (edit) Soulstace (Talk | contribs) (Displaying logs in your web browser) ← Previous diff |
Revision as of 23:49, 25 April 2008 (edit) (undo) Soulstace (Talk | contribs) m (add TOC and further detail about micro limitations) Next diff → |
||
Line 1: | Line 1: | ||
+ | ==Overview== | ||
+ | |||
DD-WRT uses the '''syslog''' and '''klog''' daemons to log system, kernel, and firewall events. This can be useful for troubleshooting purposes, or just to keep an eye on how your router/network is behaving. | DD-WRT uses the '''syslog''' and '''klog''' daemons to log system, kernel, and firewall events. This can be useful for troubleshooting purposes, or just to keep an eye on how your router/network is behaving. | ||
- | Logging is probably disabled by default. To enable it | + | ==Setup== |
+ | |||
+ | Logging is probably disabled by default. To enable it: | ||
#Enable Syslogd under the Services tab. | #Enable Syslogd under the Services tab. | ||
Line 9: | Line 13: | ||
That's all there is to it. DD-WRT should now be logging...either locally to ''/tmp/var/log/messages'', or remotely to the IP address you specified earlier. | That's all there is to it. DD-WRT should now be logging...either locally to ''/tmp/var/log/messages'', or remotely to the IP address you specified earlier. | ||
- | + | ==Recommended tools== | |
+ | |||
+ | Here are some utilities you may wish to check out if you're logging remotely: | ||
+ | |||
[http://www.sonic.net/wallwatcher/ WallWatcher]<br> | [http://www.sonic.net/wallwatcher/ WallWatcher]<br> | ||
syslog-ng ([http://www.cygwin.com/ CYGWIN])<br> | syslog-ng ([http://www.cygwin.com/ CYGWIN])<br> | ||
[http://www.kiwisyslog.com/ Kiwi Syslog] | [http://www.kiwisyslog.com/ Kiwi Syslog] | ||
- | Linux already has | + | Linux already has syslogd built in. |
- | + | ==Displaying logs in your web browser== | |
- | create a symbolic link in /tmp/www | + | create a symbolic link in /tmp/www |
- | ln -s /tmp/var/log/messages /tmp/www/log.html | + | ln -s /tmp/var/log/messages /tmp/www/log.html |
- | now go to: | + | now go to: |
http://192.168.1.1/user/log.html | http://192.168.1.1/user/log.html | ||
+ | |||
+ | (credits to kuthulu for that tip) | ||
+ | |||
+ | ====micro versions==== | ||
+ | Micro versions have a stripped down version of [http://www.busybox.net/about.html BusyBox], so it might not include the '''ln''' command used above. In that case, you can use a different method to view the logs from within your browser, shown below. | ||
+ | |||
+ | Issue the following command from the [[Web Interface]] -> Commands section (or via [[Telnet/SSH and the Command Line|Telnet]]): | ||
+ | |||
+ | cat /tmp/var/log/messages | ||
+ | |||
+ | As noted in the Setup section, the logfile in '''micro''' currently does not show any firewall events, unfortunately. | ||
[[Category: English documentation]] | [[Category: English documentation]] |
Revision as of 23:49, 25 April 2008
Contents |
Overview
DD-WRT uses the syslog and klog daemons to log system, kernel, and firewall events. This can be useful for troubleshooting purposes, or just to keep an eye on how your router/network is behaving.
Setup
Logging is probably disabled by default. To enable it:
- Enable Syslogd under the Services tab.
- If you wish to send logs to a remote system, enter the IP address of that machine which is also running a syslog utility (it needs an open network socket in order to accept logs being sent by the router).
- To log firewall events, go to the Security tab and enable the appropriate options. (Note: this doesn't function in micro)
That's all there is to it. DD-WRT should now be logging...either locally to /tmp/var/log/messages, or remotely to the IP address you specified earlier.
Recommended tools
Here are some utilities you may wish to check out if you're logging remotely:
WallWatcher
syslog-ng (CYGWIN)
Kiwi Syslog
Linux already has syslogd built in.
Displaying logs in your web browser
create a symbolic link in /tmp/www
ln -s /tmp/var/log/messages /tmp/www/log.html
now go to: http://192.168.1.1/user/log.html
(credits to kuthulu for that tip)
micro versions
Micro versions have a stripped down version of BusyBox, so it might not include the ln command used above. In that case, you can use a different method to view the logs from within your browser, shown below.
Issue the following command from the Web Interface -> Commands section (or via Telnet):
cat /tmp/var/log/messages
As noted in the Setup section, the logfile in micro currently does not show any firewall events, unfortunately.