H3C Campus Fixed-Port Switches CLI-Based Quick Start Configuration Guide-6W101

HomeSupportQuick StartH3C Campus Fixed-Port Switches CLI-Based Quick Start Configuration Guide-6W101
Table of Contents
Related Documents
31-Information Center Quick Start Configuration Guide

Information Center Quick Start Configuration Guide

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Copyright © 2022 New H3C Technologies Co., Ltd. All rights reserved.

No part of this manual may be reproduced or transmitted in any form or by any means without prior written consent of New H3C Technologies Co., Ltd.

Except for the trademarks of New H3C Technologies Co., Ltd., any trademarks that may be mentioned in this document are the property of their respective owners.

The information in this document is subject to change without notice.



Configuring the device to output logs to a log host server

Introduction

The following information uses an example to describe the basic procedure for configuring the device to output logs to a log host server.

Network configuration

As shown in Figure 1, configure the device to output logs with severity levels from 0 through 7 to the log host server.

Figure 1 Network diagram

 

Prerequisites

·     Configure IP addresses and routes. Make sure the device and the log host can reach each other. (Details not shown.)

·     Install 3CDaemon on the host as a log host server.

Procedure

1.     Configure the device:

# Enable the information center.

<Device> system-view

[Device] info-center enable

# Specify log host 1.2.0.1/16 with local7 as the logging facility.

[Device] info-center loghost 1.2.0.1 facility local7

2.     Configure the log host:

The log host server configuration procedure varies by the vendor. The following example uses 3CDaemon as the log host server to receive the logs sent by the switch.

# Open 3CDaemon and complete corresponding configurations.

Figure 2 Configuring 3CDaemon as the log host server

 

# Launch the log host server.

Verifying the configuration

# Verify that you can view logs sent by the switch on the log host server.

Figure 3 Viewing logs on 3CDaemon

 

# Open the directory where the log files are saved to view logs.

Figure 4 Viewing log file directory

 

Configuration files

#

info-center enable

 info-center loghost 1.2.0.1 facility local7

#

Related documentation

·     Information center configuration in the network management and monitoring configuration guide for the device.

·     Information center commands in the network management and monitoring command reference for the device.


Configuring the device to save logs to a specific folder in the flash drive

Introduction

The following information uses an example to describe the basic procedure for configuring the device to save logs to a specific folder in the flash drive.

Network configuration

·     Configure the device to output logs with severity levels from 0 through 7 to a log file in the flash drive. Set the maximum log file size to 1 MB.

·     Log user logins and commands executed by the user after login.

·     Save the logs to the log buffer before saving them to the log file. Set the maximum number of logs that can be buffered to 500. Set the log file saving interval to 60000 seconds.

·     Set the timestamp format to boot for output logs.

Restrictions and guidelines

The log file feature saves logs from the log file buffer to the log file at the specified saving interval. You can also manually trigger an immediate saving of buffered logs to the log file. After saving logs to the log file, the system clears the log file buffer.

Procedure

# Enter system view.

<Device> system-view

# Configure an output rule for sending logs with severity levels from 0 through 7 to the log buffer.

[Device] info-center source default logbuffer level debugging

# Enable log output to the log buffer.

[Device] info-center logbuffer

# Set the maximum number of logs that can be buffered to 500.

[Device] info-center logbuffer size 500

# Configure output of logs with severity levels from 0 through 7 to the log file.

[Device] info-center source default logfile level debugging

# Enable the log file feature.

[Device] info-center logfile enable

# Set the maximum log file size to 1 MB.

[Device] info-center logfile size-quota 1

# Configure the device to save logs to the flash:/test directory.

[Device] info-center logfile directory flash:/test

# Set the log file saving interval to 60000 seconds.

[Device] info-center logfile frequency 60000

# Set the timestamp format to boot for output logs.

[Device] info-center timestamp boot

Verifying the configuration

# View the summary of log file configurations.

[Device] display logfile summary

  Log file: Enabled

  Log file size quota: 1 MB

  Log file directory: flash:/test

  Writing frequency: 16 hour 40 min 0 sec

The output shows that the log file feature is enabled, the maximum log file size is 1 MB, the log file directory is flash:/test, and the log file saving interval is 60000 seconds.

# View information about the log buffer and the buffered logs.

[Device] display logbuffer

Log buffer: Enabled

Max buffer size: 1024

Actual buffer size: 500

Dropped messages: 0

Overwritten messages: 402788

Current messages: 500

---- More ----

The output shows that log output to the log buffer is enabled, the maximum log file buffer size is 1 MB, and the maximum number of logs that can be buffered is 500.

# View the logs sent to the flash:/test directory.

[Device] more test/logfile.log

%@3049495%0.2409505789 H3C ARP/6/ARP_TARGET_IP_INVALID: Target IP 192.168.1.60 w

as not the IP of the receiving interface M-GigabitEthernet0/0/0.

%@3049496%0.2409506971 H3C ARP/6/ARP_TARGET_IP_INVALID: Target IP 10.1.1.2 was n

ot the IP of the receiving interface M-GigabitEthernet0/0/0.

%@3049497%0.2409510823 H3C ARP/6/ARP_TARGET_IP_INVALID: Target IP 10.1.1.2 was n

ot the IP of the receiving interface M-GigabitEthernet0/0/0. This message repeat

ed 2 times in last 3 seconds.

%@3049498%0.2409510789 H3C ARP/6/ARP_TARGET_IP_INVALID: Target IP 192.168.1.60 w

as not the IP of the receiving interface M-GigabitEthernet0/0/0.

%@3049499%0.2409520259 H3C ARP/6/ARP_TARGET_IP_INVALID: Target IP 192.168.1.60 w

as not the IP of the receiving interface M-GigabitEthernet0/0/0. This message re

peated 1 times in last 10 seconds.

---- More ----

Configuration files

#

info-center timestamp boot

 info-center logfile frequency 6000

 info-center logfile size-quota 1

 info-center source default monitor deny

 info-center source default logbuffer level debugging

 info-center source default logfile level debugging

#

Related documentation

·     Information center configuration in the network management and monitoring configuration guide for the device.

·     Information center commands in the network management and monitoring command reference for the device.

 

  • Cloud & AI
  • InterConnect
  • Intelligent Computing
  • Security
  • SMB Products
  • Intelligent Terminal Products
  • Product Support Services
  • Technical Service Solutions
All Services
  • Resource Center
  • Policy
  • Online Help
All Support
  • Become a Partner
  • Partner Resources
  • Partner Business Management
All Partners
  • Profile
  • News & Events
  • Online Exhibition Center
  • Contact Us
All About Us
新华三官网