Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | |
2 | started by Ingo Molnar <mingo@redhat.com>, 2001.09.17 | |
3 | 2.6 port and netpoll api by Matt Mackall <mpm@selenic.com>, Sep 9 2003 | |
4 | ||
5 | Please send bug reports to Matt Mackall <mpm@selenic.com> | |
6 | ||
7 | This module logs kernel printk messages over UDP allowing debugging of | |
8 | problem where disk logging fails and serial consoles are impractical. | |
9 | ||
10 | It can be used either built-in or as a module. As a built-in, | |
11 | netconsole initializes immediately after NIC cards and will bring up | |
12 | the specified interface as soon as possible. While this doesn't allow | |
13 | capture of early kernel panics, it does capture most of the boot | |
14 | process. | |
15 | ||
16 | It takes a string configuration parameter "netconsole" in the | |
17 | following format: | |
18 | ||
19 | netconsole=[src-port]@[src-ip]/[<dev>],[tgt-port]@<tgt-ip>/[tgt-macaddr] | |
20 | ||
21 | where | |
22 | src-port source for UDP packets (defaults to 6665) | |
23 | src-ip source IP to use (interface address) | |
24 | dev network interface (eth0) | |
25 | tgt-port port for logging agent (6666) | |
26 | tgt-ip IP address for logging agent | |
27 | tgt-macaddr ethernet MAC address for logging agent (broadcast) | |
28 | ||
29 | Examples: | |
30 | ||
31 | linux netconsole=4444@10.0.0.1/eth1,9353@10.0.0.2/12:34:56:78:9a:bc | |
32 | ||
33 | or | |
34 | ||
35 | insmod netconsole netconsole=@/,@10.0.0.2/ | |
36 | ||
37 | Built-in netconsole starts immediately after the TCP stack is | |
38 | initialized and attempts to bring up the supplied dev at the supplied | |
39 | address. | |
40 | ||
41 | The remote host can run either 'netcat -u -l -p <port>' or syslogd. | |
42 | ||
43 | WARNING: the default target ethernet setting uses the broadcast | |
44 | ethernet address to send packets, which can cause increased load on | |
45 | other systems on the same ethernet segment. | |
46 | ||
8d4ef88b SS |
47 | TIP: some LAN switches may be configured to suppress ethernet broadcasts |
48 | so it is advised to explicitly specify the remote agents' MAC addresses | |
49 | from the config parameters passed to netconsole. | |
50 | ||
51 | TIP: to find out the MAC address of, say, 10.0.0.2, you may try using: | |
52 | ||
53 | ping -c 1 10.0.0.2 ; /sbin/arp -n | grep 10.0.0.2 | |
54 | ||
55 | TIP: in case the remote logging agent is on a separate LAN subnet than | |
56 | the sender, it is suggested to try specifying the MAC address of the | |
57 | default gateway (you may use /sbin/route -n to find it out) as the | |
58 | remote MAC address instead. | |
59 | ||
1da177e4 LT |
60 | NOTE: the network device (eth1 in the above case) can run any kind |
61 | of other network traffic, netconsole is not intrusive. Netconsole | |
62 | might cause slight delays in other traffic if the volume of kernel | |
63 | messages is high, but should have no other impact. | |
64 | ||
8d4ef88b SS |
65 | NOTE: if you find that the remote logging agent is not receiving or |
66 | printing all messages from the sender, it is likely that you have set | |
67 | the "console_loglevel" parameter (on the sender) to only send high | |
68 | priority messages to the console. You can change this at runtime using: | |
69 | ||
70 | dmesg -n 8 | |
71 | ||
72 | or by specifying "debug" on the kernel command line at boot, to send | |
73 | all kernel messages to the console. A specific value for this parameter | |
74 | can also be set using the "loglevel" kernel boot option. See the | |
75 | dmesg(8) man page and Documentation/kernel-parameters.txt for details. | |
76 | ||
1da177e4 LT |
77 | Netconsole was designed to be as instantaneous as possible, to |
78 | enable the logging of even the most critical kernel bugs. It works | |
79 | from IRQ contexts as well, and does not enable interrupts while | |
84eb8d06 | 80 | sending packets. Due to these unique needs, configuration cannot |
1da177e4 LT |
81 | be more automatic, and some fundamental limitations will remain: |
82 | only IP networks, UDP packets and ethernet devices are supported. |