How do I configure netconsole under Red Hat Enterprise Linux?

Solution Verified - Updated

Environment

  • Red Hat Enterprise Linux 5, 6, 7

    • kernel
    • initscripts
  • Red Hat Enterprise Linux 3, 4

    • kernel
    • netdump

Issue

  • How to configure netconsole ?

Resolution

netconsole allows dmesg output to be transmitted via the network through the use of syslog. It implements kernel-level network logging via UDP port 514.

It is necessary to have a syslog server on the network with syslogd listening on port 514/udp. To configure syslogd to listen to port 514/udp and receive messages from the network, configure the /etc/sysconfig/syslog file with the following options:

SYSLOGD_OPTIONS="-m 0 -r -x"

And restart the syslogd daemon for the changes to take effect.

# service syslog restart

To verify that syslogd is listening on 514/udp, enter:

# lsof -nn -p `pidof syslogd` | grep UDP
syslogd 2885 root 13u IPv4 6417 UDP *:syslog

In this case it is listening on UDP *:syslog, where syslog is the port 514/udp as defined in /etc/services.

For RHEL6/7, syslogd package is replaced by rsyslog. This content is not included.This content is not included.https://access.redhat.com/site/solutions/54363

For Red Hat Enterprise Linux 3 and 4

The configuration file of netconsole is /etc/sysconfig/netdump, which is provided by netdump. You need to change the SYSLOGADDR variable in the file /etc/sysconfig/netdump and this variable contains the IP address of the syslogd server.

SYSLOGADDR=192.168.0.1

Then it is necessary to restart the netdump service to make the changes take effect because netconsole is started on the same script as netdump:

# service netdump restart

Make it run on the next reboot:

# chkconfig netdump on
For Red Hat Enterprise Linux 5 and 6

netconsole is configured via the file /etc/sysconfig/netconsole, which is part of the initscripts package. In the file /etc/sysconfig/netconsole, set the variable SYSLOGADDR to the IP address of the syslogd server:

SYSLOGADDR=192.168.0.1

Restart the netconsole service so the changes take effect, and run it on next reboot with the following command:

# service netconsole restart
# chkconfig netconsole on
For Red Hat Enterprise Linux 7

netconsole is configured via the file /etc/sysconfig/netconsole, which is part of the initscripts package. In the file /etc/sysconfig/netconsole, set the variable SYSLOGADDR to the IP address of the syslogd server:

SYSLOGADDR=192.168.0.1

Restart the netconsole service so the changes take effect, and run it on next reboot with the following command:

# systemctl restart netconsole.service
# chkconfig netconsole on

By default, the syslogd server writes the netconsole messages from the client on /var/log/messages or on the file specified in syslog.conf.

Components

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.