'''netconsole''' is a kernel module that sends all kernel log messages (i.e. [[dmesg]]) over the network to another computer, without involving user space (e.g. syslogd). Name "netconsole" is a misnomer because it's not really a "console", more like a remote logging service.

'''netconsole''' is a kernel module that sends all kernel log messages (i.e. [[dmesg]]) over the network to another computer, without involving user space (e.g. syslogd). Name "netconsole" is a misnomer because it's not really a "console", more like a remote logging service.

Line 6:

Line 8:

Documentation is available in the Linux kernel tree under '''[http://lxr.linux.no/linux+v2.6.32/Documentation/networking/netconsole.txt Documentation/networking/netconsole.txt]'''

Documentation is available in the Linux kernel tree under '''[http://lxr.linux.no/linux+v2.6.32/Documentation/networking/netconsole.txt Documentation/networking/netconsole.txt]'''

−

== Installation ==

== Installation ==

−

If not included with OS, ''Netconsole'' can be installed from the depository:

+

Install {{pkg|gnu-netcat}} from the [[official repositories]].

−

−

pacman -Sy netcat

== Build-in Configuration ==

== Build-in Configuration ==

Line 61:

Line 60:

== Receiver ==

== Receiver ==

−

<pre>

+

nc -u -l 6666

−

nc -u -l 6666

−

</pre>

or

or

−

<pre>

+

nc -u -l -p 6666

−

nc -u -l -p 6666

−

</pre>

−

== Starting at Boot ==

== Starting at Boot ==

Revision as of 06:41, 8 March 2013

zh-CN:Netconsolenetconsole is a kernel module that sends all kernel log messages (i.e. dmesg) over the network to another computer, without involving user space (e.g. syslogd). Name "netconsole" is a misnomer because it's not really a "console", more like a remote logging service.

It can be used either built-in or as a module. Built-in netconsole initializes immediately after NIC cards and will bring up the specified interface as soon as possible. The module is mainly used for capturing kernel panic output from a headless machine, or in other situations where the user space is no more functional.

Contents

Installation

Build-in Configuration

Netconsole and other modules' Kernel parameters can be passed from a bootloader to kernel at its startup via kernel command line by modifying the bootloader environment, which is type and version specific. Example for Uboot, where 1st address is Plug Computer ArchLinux device's netconsole Out Port & IP, and 2nd address is your PC's netconsole In Port & IP & adapter MAC:

Logging is done by your ArchLinux set logger like syslog-ng, so available loglevels (output details) are defined in that logger docs, and may differ for each log type. One can also pass netconsole string parameters at kernel runtime (no config file required), then start two netconsole instances on the monitoring PC (one to read output, another for input), and restart it on the PC or device you are logging as shown in Dynamic Configuration:

One may need to switch off PC and router firewall, and setup proper router port forwarding to monitor and input data in Netconsole.

Dynamic configuration

Netconsole can be loaded as one of kernel modules manually after boot or auto during boot depending on this module config. See kernel modules for configuring it to load at boot. For loading manually any time after boot: