Log output to a linux log host – H3C Technologies H3C WX3000 Series Unified Switches User Manual

Page 551

Advertising
background image

51-15

Step 3: After the log file “information” is created and the file “/etc/syslog.conf” is modified, execute the
following command to send a HUP signal to the system daemon “syslogd”, so that it can reread its
configuration file “/etc/syslog.conf”.

# ps -ae | grep syslogd

147

# kill -HUP 147

After all the above operations, the device can make records in the corresponding log file.

Through combined configuration of the device name (facility), information severity level threshold
(severity), module name (filter) and the file “syslog.conf”, you can sort information precisely for filtering.

Log Output to a Linux Log Host

Network requirements

As shown in

Figure 51-2

, Switch sends the following log information to the Linux log host whose IP

address is 202.38.1.10: All modules' log information, with severity higher than “errors”.

Figure 51-2

Network diagram for log output to a Linux log host

Internet

PC

Switch

Configuration procedure

1) Configure

Switch:

# Enable the information center.

<Switch> system-view

[Switch] info-center enable

# Configure the host whose IP address is 202.38.1.10 as the log host. Permit all modules to output log
information with severity level higher than error to the log host.

[Switch] info-center loghost 202.38.1.10 facility local7

[Switch] info-center source default channel loghost log level errors debug state off trap

state off

2) Configure the log host:

Step 1: Execute the following commands as a super user (root user).

# mkdir /var/log/Switch

# touch /var/log/Switch/information

Step 2: Edit the file “/etc/syslog.conf” as the super user (root user) to add the following selector/action
pairs.

# Switch configuration messages

local7.info /var/log/Switch/information

Advertising