diff options
Diffstat (limited to 'Documentation/networking/netconsole.txt')
-rw-r--r-- | Documentation/networking/netconsole.txt | 99 |
1 files changed, 99 insertions, 0 deletions
diff --git a/Documentation/networking/netconsole.txt b/Documentation/networking/netconsole.txt index 1caa6c734691..3c2f2b328638 100644 --- a/Documentation/networking/netconsole.txt +++ b/Documentation/networking/netconsole.txt | |||
@@ -3,6 +3,10 @@ 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 | 3 | 2.6 port and netpoll api by Matt Mackall <mpm@selenic.com>, Sep 9 2003 |
4 | 4 | ||
5 | Please send bug reports to Matt Mackall <mpm@selenic.com> | 5 | Please send bug reports to Matt Mackall <mpm@selenic.com> |
6 | and Satyam Sharma <satyam.sharma@gmail.com> | ||
7 | |||
8 | Introduction: | ||
9 | ============= | ||
6 | 10 | ||
7 | This module logs kernel printk messages over UDP allowing debugging of | 11 | This module logs kernel printk messages over UDP allowing debugging of |
8 | problem where disk logging fails and serial consoles are impractical. | 12 | problem where disk logging fails and serial consoles are impractical. |
@@ -13,6 +17,9 @@ 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 | 17 | capture of early kernel panics, it does capture most of the boot |
14 | process. | 18 | process. |
15 | 19 | ||
20 | Sender and receiver configuration: | ||
21 | ================================== | ||
22 | |||
16 | It takes a string configuration parameter "netconsole" in the | 23 | It takes a string configuration parameter "netconsole" in the |
17 | following format: | 24 | following format: |
18 | 25 | ||
@@ -34,21 +41,113 @@ Examples: | |||
34 | 41 | ||
35 | insmod netconsole netconsole=@/,@10.0.0.2/ | 42 | insmod netconsole netconsole=@/,@10.0.0.2/ |
36 | 43 | ||
44 | It also supports logging to multiple remote agents by specifying | ||
45 | parameters for the multiple agents separated by semicolons and the | ||
46 | complete string enclosed in "quotes", thusly: | ||
47 | |||
48 | modprobe netconsole netconsole="@/,@10.0.0.2/;@/eth1,6892@10.0.0.3/" | ||
49 | |||
37 | Built-in netconsole starts immediately after the TCP stack is | 50 | Built-in netconsole starts immediately after the TCP stack is |
38 | initialized and attempts to bring up the supplied dev at the supplied | 51 | initialized and attempts to bring up the supplied dev at the supplied |
39 | address. | 52 | address. |
40 | 53 | ||
41 | The remote host can run either 'netcat -u -l -p <port>' or syslogd. | 54 | The remote host can run either 'netcat -u -l -p <port>' or syslogd. |
42 | 55 | ||
56 | Dynamic reconfiguration: | ||
57 | ======================== | ||
58 | |||
59 | Dynamic reconfigurability is a useful addition to netconsole that enables | ||
60 | remote logging targets to be dynamically added, removed, or have their | ||
61 | parameters reconfigured at runtime from a configfs-based userspace interface. | ||
62 | [ Note that the parameters of netconsole targets that were specified/created | ||
63 | from the boot/module option are not exposed via this interface, and hence | ||
64 | cannot be modified dynamically. ] | ||
65 | |||
66 | To include this feature, select CONFIG_NETCONSOLE_DYNAMIC when building the | ||
67 | netconsole module (or kernel, if netconsole is built-in). | ||
68 | |||
69 | Some examples follow (where configfs is mounted at the /sys/kernel/config | ||
70 | mountpoint). | ||
71 | |||
72 | To add a remote logging target (target names can be arbitrary): | ||
73 | |||
74 | cd /sys/kernel/config/netconsole/ | ||
75 | mkdir target1 | ||
76 | |||
77 | Note that newly created targets have default parameter values (as mentioned | ||
78 | above) and are disabled by default -- they must first be enabled by writing | ||
79 | "1" to the "enabled" attribute (usually after setting parameters accordingly) | ||
80 | as described below. | ||
81 | |||
82 | To remove a target: | ||
83 | |||
84 | rmdir /sys/kernel/config/netconsole/othertarget/ | ||
85 | |||
86 | The interface exposes these parameters of a netconsole target to userspace: | ||
87 | |||
88 | enabled Is this target currently enabled? (read-write) | ||
89 | dev_name Local network interface name (read-write) | ||
90 | local_port Source UDP port to use (read-write) | ||
91 | remote_port Remote agent's UDP port (read-write) | ||
92 | local_ip Source IP address to use (read-write) | ||
93 | remote_ip Remote agent's IP address (read-write) | ||
94 | local_mac Local interface's MAC address (read-only) | ||
95 | remote_mac Remote agent's MAC address (read-write) | ||
96 | |||
97 | The "enabled" attribute is also used to control whether the parameters of | ||
98 | a target can be updated or not -- you can modify the parameters of only | ||
99 | disabled targets (i.e. if "enabled" is 0). | ||
100 | |||
101 | To update a target's parameters: | ||
102 | |||
103 | cat enabled # check if enabled is 1 | ||
104 | echo 0 > enabled # disable the target (if required) | ||
105 | echo eth2 > dev_name # set local interface | ||
106 | echo 10.0.0.4 > remote_ip # update some parameter | ||
107 | echo cb:a9:87:65:43:21 > remote_mac # update more parameters | ||
108 | echo 1 > enabled # enable target again | ||
109 | |||
110 | You can also update the local interface dynamically. This is especially | ||
111 | useful if you want to use interfaces that have newly come up (and may not | ||
112 | have existed when netconsole was loaded / initialized). | ||
113 | |||
114 | Miscellaneous notes: | ||
115 | ==================== | ||
116 | |||
43 | WARNING: the default target ethernet setting uses the broadcast | 117 | WARNING: the default target ethernet setting uses the broadcast |
44 | ethernet address to send packets, which can cause increased load on | 118 | ethernet address to send packets, which can cause increased load on |
45 | other systems on the same ethernet segment. | 119 | other systems on the same ethernet segment. |
46 | 120 | ||
121 | TIP: some LAN switches may be configured to suppress ethernet broadcasts | ||
122 | so it is advised to explicitly specify the remote agents' MAC addresses | ||
123 | from the config parameters passed to netconsole. | ||
124 | |||
125 | TIP: to find out the MAC address of, say, 10.0.0.2, you may try using: | ||
126 | |||
127 | ping -c 1 10.0.0.2 ; /sbin/arp -n | grep 10.0.0.2 | ||
128 | |||
129 | TIP: in case the remote logging agent is on a separate LAN subnet than | ||
130 | the sender, it is suggested to try specifying the MAC address of the | ||
131 | default gateway (you may use /sbin/route -n to find it out) as the | ||
132 | remote MAC address instead. | ||
133 | |||
47 | NOTE: the network device (eth1 in the above case) can run any kind | 134 | NOTE: the network device (eth1 in the above case) can run any kind |
48 | of other network traffic, netconsole is not intrusive. Netconsole | 135 | of other network traffic, netconsole is not intrusive. Netconsole |
49 | might cause slight delays in other traffic if the volume of kernel | 136 | might cause slight delays in other traffic if the volume of kernel |
50 | messages is high, but should have no other impact. | 137 | messages is high, but should have no other impact. |
51 | 138 | ||
139 | NOTE: if you find that the remote logging agent is not receiving or | ||
140 | printing all messages from the sender, it is likely that you have set | ||
141 | the "console_loglevel" parameter (on the sender) to only send high | ||
142 | priority messages to the console. You can change this at runtime using: | ||
143 | |||
144 | dmesg -n 8 | ||
145 | |||
146 | or by specifying "debug" on the kernel command line at boot, to send | ||
147 | all kernel messages to the console. A specific value for this parameter | ||
148 | can also be set using the "loglevel" kernel boot option. See the | ||
149 | dmesg(8) man page and Documentation/kernel-parameters.txt for details. | ||
150 | |||
52 | Netconsole was designed to be as instantaneous as possible, to | 151 | Netconsole was designed to be as instantaneous as possible, to |
53 | enable the logging of even the most critical kernel bugs. It works | 152 | enable the logging of even the most critical kernel bugs. It works |
54 | from IRQ contexts as well, and does not enable interrupts while | 153 | from IRQ contexts as well, and does not enable interrupts while |