No relevant resource is found in the selected language.

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Read our privacy policy>Search

Reminder

To have a better experience, please upgrade your IE browser.

upgrade

Obtaining Log Files from S5700

Rate and give feedback:
Huawei uses machine translation combined with human proofreading to translate this document to different languages in order to help you better understand the content of this document. Note: Even the most advanced machine translation cannot match the quality of professional translators. Huawei shall not bear any responsibility for translation accuracy and it is recommended that you refer to the English document (a link for which has been provided).
Obtaining Log Files from S5700

Obtaining Log Files from S5700

Introduction

This document describes the types and storage modes of log files supported by S series switches and how to obtain log files.

Log File Format

Log files of a switch are classified into: user log files and diagnostic log files.

  • A user log file records important operations such as device restart and trap information.
  • A diagnostic log file records the service processing flow and fault information.

Log File Format

User log files and diagnostic log files are stored in the storage path/logfile/ directory. The file names are log.log and log.dblg respectively.

<HUAWEI> dir
Directory of flash:/

  Idx  Attr     Size(Byte)  Date        Time       FileName                                                                          
    0  drw-              -  Apr 22 2015 11:13:17   lost+found                                                                        
    1  -rw-             14  Dec 05 2018 17:21:22   back_time_a                                                                       
    2  -rw-      1,978,136  Oct 08 2018 10:04:23   help.web                                                                          
    3  drw-              -  Dec 04 2018 19:20:51   logfile
    4  drw-              -  Apr 22 2015 11:25:55   pmdata                                                                            
    5  drw-              -  Apr 22 2015 11:25:56   user                                                                              
    6  drw-              -  Nov 29 2017 10:18:42   unimng                                                                            
    7  drw-              -  Apr 22 2015 11:26:04   sysdrv                                                                            
    8  drw-              -  Aug 10 2017 16:57:19   selftest                                                                          
    9  -rw-          9,824  Dec 04 2018 17:23:39   private-data.txt                                                                  
   10  -rw-          6,773  Dec 04 2018 17:23:38   vrpcfg.zip                                                                        
   11  -rw-             14  Dec 05 2018 17:21:22   back_time_b                                                                       
   12  drw-              -  Nov 12 2018 15:08:43   localuser                                                                         
   13  drw-              -  Sep 25 2015 16:13:49   dhcp                                                                              
   14  -rw-         14,416  May 14 2018 11:24:21   oom-killer.txt                                                                    
   15  drw-              -  Apr 17 2018 22:45:07   openmng                                                                           
   16  -rw-              4  Oct 24 2018 16:39:43   snmpnotilog.txt     
<HUAWEI> cd logfile
Directory of flash:/logfile/

  Idx  Attr     Size(Byte)  Date        Time       FileName                                                                          
   47  -rw-        800,474  Sep 04 2018 11:09:15   2018-09-04.11-09-02.dblg.zip                                                      
   48  -rw-      1,472,144  Dec 05 2018 16:35:08   log.log
   49  -rw-        951,656  Nov 13 2018 21:38:08   2018-11-13.21-37-54.dblg.zip                                                      
   50  -rw-        803,565  Sep 15 2018 03:44:32   2018-09-15.03-44-18.dblg.zip                                                      
   51  -rw-        797,445  Sep 18 2018 20:29:44   2018-09-18.20-29-30.dblg.zip    
  108  -rw-      6,487,049  Dec 05 2018 17:10:57   log.dblg
Run the dir ? command in a CSS to view the storage path of the CSS.
<HUAWEI> dir ?    
  1/9#flash:        Device name                        
  1/10#flash:       Device name                        
  2/10#flash:       Device name                        
  2/9#flash:        Device name                        
  /all              List all files                     
  /all-filesystems  List files on all filesystems      
  STRING            [drive][path][file name]           
  flash:            Device name 

For example, view the log file in the 1/9#flash: directory.

<HUAWEI> dir 1/9#flash:   
Directory of 1/9#flash:/                                                                                                            

  Idx  Attr     Size(Byte)  Date        Time       FileName                                                                         
    0  drw-              -  Jun 29 2018 10:17:36   lost+found                                                                       
    1  drw-              -  Jun 04 2019 14:20:48   logfile                                                                          
    2  -rw-          7,779  Jun 04 2019 14:34:11   root.cer                                                                         
    3  -rw-          3,094  Jun 04 2019 14:34:12   device.pem                                                                       
    4  drw-              -  Jun 29 2018 10:18:44   pmdata                                                                           
    5  drw-              -  Jun 29 2018 10:18:45   user                                                                             
    6  drw-              -  Jun 29 2018 10:18:50   unimng                                                                           
    7  drw-              -  Jun 29 2018 10:18:50   sysdrv                                                                           
    8  -rw-         23,695  Jun 04 2019 14:36:47   private-data.txt                                                                 
    9  drw-              -  Jun 04 2019 14:36:46   dhcp                                                                             
   10  drw-              -  Jan 31 2019 16:19:24   selftest                                                                         
   11  -rw-             36  Jun 04 2019 14:38:02   $_patchstate_reboot                                                              
   12  -rw-            200  Mar 21 2019 15:37:02   ca_config.ini                                                                    
   13  -rw-          2,759  Jun 04 2019 14:26:12   vrpcfg.zip                                                                       
   14  -rw-             14  Jun 04 2019 14:34:25   back_time_a                                                                      
   15  -rw-             14  Jun 04 2019 14:34:26   back_time_b                                                                      
   16  -rw-              4  Jun 02 2019 14:45:35   snmpnotilog.txt                                                                  
   17  -rw-          3,684  Jun 04 2019 14:35:02   $_patch_history                                                                  
   18  -rw-        866,481  Jun 04 2019 14:36:50   dump.rdb                                                                         
   19  drw-              -  Jan 30 2019 16:07:30   huwei                                                                            
   20  drw-              -  Aug 03 2018 17:17:50   $_backup                                                                         
   21  drw-              -  Mar 26 2019 21:59:11   localuser                                                                        
   22  -rw-         13,432  May 16 2019 18:56:21   default_ca.cer                                                                   
   23  -rw-          1,220  May 16 2019 18:56:21   default_local.cer                                                                
   24  -rw-          1,977  Jun 04 2019 14:26:15   startup.rdb                                                                      
   25  drw-              -  Jun 04 2019 14:29:08   oids                                                                             
   26  drw-              -  May 27 2019 15:00:01   sessionlog                                                                       
   27  drw-              -  May 16 2019 19:04:05   $_user                                                                           
   28  -rw-              2  Jun 04 2019 15:04:51   radio_info.txt                                                                   
   29  -rw-          6,494  May 29 2019 19:21:43   patch12700_zhw_05_29--1.pat                                                      
   30  -rw-         11,078  May 29 2019 19:39:50   patch12700_zhw_05_29--2.pat                                                      
   31  -rw-         10,750  May 28 2019 11:03:51   patch12700_zhw--4.pat                                                            
   32  -rw-         11,982  May 28 2019 11:29:00   patch12700_zhw--5.pat                                                            
   33  -rw-    376,649,781  Jun 01 2019 14:39:27   s12700-v200r019c00spc100b230-mpua.cc                                             
   34  -rw-          2,759  Jun 04 2019 14:29:06   vrpcfg20190604142906.zip                                                         
   35  -rw-    376,714,925  Jun 04 2019 09:50:03   s12700-v200r019c00spc100b233-mpua.cc                                             
   36  -rw-      1,105,674  Jun 04 2019 10:56:34   patch_12700test_3_b233.pat                                                       
   37  -rw-    374,505,837  Jun 04 2019 14:20:42   s12700-v200r019c00spc200b216-mpua.cc                                             
   38  drw-              -  Jun 04 2019 14:36:34   $_install_mod   
<HUAWEI> cd 1/9#flash:    
<HUAWEI> cd logfile/ 
<HUAWEI> dir 
Directory of 1/9#flash:/logfile/                                                                                                    

  Idx  Attr     Size(Byte)  Date        Time       FileName                                                                         
    0  -rw-      5,250,794  Jun 04 2019 17:14:23   log.dblg                                                                         
    1  -rw-      8,023,965  Jun 04 2019 14:45:20   log.log                                                                          
    2  -rw-        806,190  Jun 03 2019 11:46:09   2019-06-03.11-46-04.dblg.zip                                                     
    3  -rw-        816,070  Jun 03 2019 18:59:25   2019-06-03.18-59-20.dblg.zip                                                     
    4  -rw-        840,218  Jun 04 2019 02:35:24   2019-06-04.02-35-20.dblg.zip                                                     
    5  -rw-        883,259  Jun 04 2019 10:29:03   2019-06-04.10-28-58.dblg.zip                                                     
    6  -rw-      1,442,981  Jun 04 2019 11:55:02   2019-06-04.11-54-55.dblg.zip                                                     
    7  -rw-      1,573,424  Jun 04 2019 13:02:09   2019-06-04.13-02-02.dblg.zip                                                     
    8  -rw-        116,151  Jun 04 2019 13:09:47   2019-06-04.11-09-26.dblg.zip                                                     
    9  -rw-      1,609,891  Jun 04 2019 14:20:47   2019-06-04.14-19-57.dblg.zip                                                     

1,951,312 KB total (700,524 KB free) 

The log information generated by the switch is recorded in the log buffer and then saved to a log file automatically or manually.

  • Automatic save: Since the switch starts, logs in the log buffer will be automatically saved to a log file every 24 hours. This saving interval cannot be configured.
  • Automatic save: When the 64-KB log buffer is full, logs in the log buffer will be automatically saved to a log file. The log buffer size cannot be configured.
  • Manual save: The save logfile or save logfile all command can be executed to manually save the log information in the log buffer to a log file. The save logfile command can save only the log information in the user log buffer to a log file. The save logfile all command can save the log information in both the user log buffer and diagnostic log buffer.

When a log file exceeds the specified size, the system compresses it into a zip file and names the zip file date.log.zip and date.dblg.zip, for example, 2013-08-14.04-55-23.log.zip and 2013-09-05.05-15-23.dblg.zip. By default, a log file is compressed when it exceeds 8 MB. To configure the log file size, run the info-center logfile size size command.

Obtaining Log Files

For a specific user log file, run the display logfile file-name command on the switch to view the file or download the file to a local directory through FTP. Before running a command to view user log files or obtain user log files through FTP, you are advised to run the save logfile or save logfile all command to save the log information in the log buffer to a log file.

<HUAWEI> display logfile log.log
################################################################ 
#     This logfile is generated at slot 0 
################################################################ 

Aug 21 2018 16:46:26 HUAWEI LLDP/4/ADDCHGTRAP:OID 1.3.6.1.4.1.2011.5.25.134.2.5 Local management address is changed. (LocManAddr=b443-26ca-2a50) 
Aug 21 2018 16:45:59 HUAWEI %%01GTL/4/STATECHANGED(l)[1]:License state changed from Default to Default. 
Aug 21 2018 16:46:28 HUAWEI SNMP/4/COLDSTART:OID 1.3.6.1.6.3.1.1.5.1 coldStart. 
Aug 21 2018 16:46:12 HUAWEI %%01PDF/4/OPENPDFRFAIL(l)[4]:Failed to open PDF file in binary read mode when reading private data. 
Aug 21 2018 16:46:30 HUAWEI LLDP/4/ADDCHGTRAP:OID 1.3.6.1.4.1.2011.5.25.134.2.5 Local management address is changed. (LocManAddr=192.168.1.253) 
Aug 21 2018 16:46:24 HUAWEI %%01UVM/6/CREATEDIR(l)[6]:The directory "flash:/unimng/" is automatically created. 
Aug 21 2018 16:46:24 HUAWEI %%01UVM/6/CREATEDIR(l)[7]:The directory "flash:/unimng/ind-cfg/" is automatically created. 
Aug 21 2018 16:46:26 HUAWEI %%01VFS/6/DEV_REG(l)[8]:Device flash: registration finished. 
Aug 21 2018 16:46:27 HUAWEI %%01IFNET/6/IF_INFO_CHANGE(l)[9]:The interface MEth0/0/1 changed the Baud from 100000000 bit to 10000000 bit. 
Aug 21 2018 16:46:27 HUAWEI %%01PDF/4/OPENPDFRFAIL(l)[10]:Failed to open PDF file in binary read mode when reading private data. 
Aug 21 2018 16:46:27 HUAWEI %%01ALML/4/ENTUP(l)[11]:Board[0] registers successfully, the barcode is: 2102351XFS0821164023

As the network scale expands and network complexity increases, the log information generated by the device keeps increasing. To save storage space and reduce the number of disk write operations, you need to increase the log storage space and save interval of the device. This improves the log processing efficiency and prolongs the service life of storage devices. The log information in diagnostic log files is recorded in binary format. The binary log format can save storage space and prolong the lifecycle of storage devices. For example, an 8 MB binary log file of 8 MB will be parsed into a 21 MB text log file.

The switch can write logs to a log file in binary format. A binary log file consists of:

  • Variable information, such as time
  • Fixed information

Each log has a unique ID, and fixed information in each log can be identified by its ID. For this reason, binary log files record only variable parameters and unique log IDs.

For example, a log whose log ID is 1078464521 contains the following registration information:

The user chose N when deciding whether to reboot the system.

Under normal circumstances, the following information is saved:

2009-5-21 19:46:52 Switch %%01CMD/4/REBOOT(l):The user chose N when deciding whether to reboot the system.

When the log is saved in binary format, only variable parameters are saved:

Time (2009-5-21 19:46:52) + ID (1078464521) + Variable parameter (N)

You can view a binary log file in the following ways:

  • Copy the binary log file to a local directory and use a data dictionary and a log parsing tool.

    A data dictionary is a centralized repository of information about all modules in the system, such as the log ID and format string. It can be generated on the switch using commands. The log parsing tool is an executable file. This tool searches the data dictionary downloaded to the local PC for the fixed information associated with the log ID in the binary log file. Then it combines the fixed information in the data dictionary with variable parameters in the binary log file to create a complete log. To obtain the log parsing tool, contact technical support personnel.

  • Run the display diag-logfile command to view the log information in a binary log file.

    In this case, a complete log is also generated by combing fixed information with variable information. This method does not generate an independent data dictionary and does not require a log parsing tool. Log parsing is automatically completed by the system.

Translation
Download
Updated: 2019-06-29

Document ID: EDOC1100088106

Views: 601

Downloads: 16

Average rating:
This Document Applies to these Products
Related Documents
Related Version
Share
Previous Next