Netconsole howto

  • 7000330
  • 07-May-2008
  • 27-Apr-2012

Environment

Novell Open Enterprise Server (Linux based)
Novell SUSE Linux Enterprise Server 10
Novell SUSE Linux Enterprise Server 9

Situation

Kernel boot messages need to be saved after a server crash/hang but access to a serial console is not available.

Resolution

Use netconsole to send kernel boot messages to another server on the network.

Additional Information

Senderconfiguration:

Configure the system that will generate the kernel messages as following:
  1. Load the netconsole module at boot time. Edit /etc/sysconfig/kernel and add:
    MODULES_LOADED_ON_BOOT="netconsole"
  2. Set netconsole module options. Edit /etc/modprobe.conf.local and add:
    options netconsole netconsole=4444@10.0.0.1/eth0,6666@10.0.0.2/00:1A:A0:D2:55:66
Explanation:

Sender source port: 4444
Sender IP: 10.0.0.1
Sender NIC: eth0
Recipient listening port: 6666
Recipient IP: 10.0.0.2
Recipient MAC: 00:1A:A0:D2:55:66

Note:
In case the remote logging client is on a separate subnet than the sender, specify the MAC address of the default gateway instead of the actual MAC address of the recipient system.

Recipient configuration:

  1. Open firewall port. Edit /etc/sysconfig/SuSEfirewall2 and set:
    FW_ALLOW_INCOMING_HIGHPORTS_UDP="6666"

  2. Restart firewall:
    rcSuSEfirewall2 restart

  3. Configure syslog-ng. Edit/etc/syslog-ng/syslog-ng and add:
    source net { udp(ip("0.0.0.0") port(6666)); };
    destination netconsole { file("/var/log/$HOST-netconsole.log"); };
    log { source(net); destination(netconsole); };

  4. Restart syslog-ng:
    rcsyslog restart
On the recipient system, logs are written to/var/log/$hostname-netconsole.log

External links

More details can be found on coolsolutions.