Knowledge Search


×
 

Collecting Logs from EX series devices using the 'file archive' command

  [KB20569] Show Article Properties


Summary:

This article will help you collecting logs from EX series devices which may play a vital role in Root Cause Analysis (RCA).


Symptoms:

Collect all the logs on the EX device using the 'file archive' command.  The 'file archive' command provides a simple way to zip (tar) files.


Solution:

Collecting logs differs across the EX platforms.  Follow the steps for your particular EX device:



Collecting Logs from a Stand-alone switch

  1. Login to the device.

  2. Enter the following command to archive the /var/log directory.  The following command will zip (tar) the folder "/var/log" and name the file (LOGS.tar).  It also pushes the zipped file to the destination folder "/var/tmp".
  3. root@lab> file archive source /var/log destination /var/tmp/LOGS
  4. Perform the steps under the section Export the Archived Logs in order to copy the archived logs to your PC or another source.

  5. IMPORTANT:
    The archive includes several files.  Therefore, specify the actual date/time of the outage to be analyzed when giving the archived logs to your technical support representative. This will help speed up the analysis.


Collecting Logs from Virtual Chassis

Note: Collecting the logs should be Initiated from the Master.

  1. Login to the Master.  Here we assume FPC0 is the master.

  2. Enter the following command to archive the /var/log directory of the Master.  The following command will zip (tar) the folder "/var/log" and name the file (MASTER-LOG.tar).  It also pushes the zipped file to the Master switch.  The destination folder remains "/var/tmp".
  3. {master:0}
    root@lab> file archive source /var/log destination fpc0:/var/tmp/MASTER-LOG

  4. Login to the Backup - Here we assume FPC1 will be the Backup & FPC0 remains Master.
  5. {master:0}
    root@lab> request session member <Member ID>    (For FPC1 it will be 1)
    root@lab% cli
    {backup:1}

  6. Enter the following command to archive the /var/log directory of the Backup.  The following command will zip (tar) the folder "/var/log" and name the file (BACKUP-LOG.tar).  It also pushes the zipped file to the Master switch (FPC0).  The destination folder remains "/var/tmp".
  7. {backup:1}
    root@lab> file archive source /var/log destination fpc0:/var/tmp/BACKUP-LOG

  8. Login to the Other Linecard members - Here we assume FPC2 will be the other linecard member and considering FPC0 remains master. (Please replace FPC2 with respective Member ID.)
  9. {backup:1}
    root@lab> request session member 2    (For FPC2 it will be 2)
    root@lab% cli
    {backup:2}

  10. Enter the following command to archive the /var/log directory of the other Linecard members.  The following command will zip (tar) the folder "/var/log" and name the file (LC-FPC2-LOG.tar).  It also pushes the zipped file to the Master switch.  The destination folder remains "/var/tmp".
  11. root@lab> file archive source /var/log destination fpc0:/var/tmp/LC-FPC2-LOG
  12. Login to the Master and make sure desired files been saved in the /var/tmp directory:
  13. root@lab:RE0% cd /var/tmp
    root@lab:RE0% ls
    .snap                            LC-FPC2-LOG.tar                   LC-FPC2-LOG.tar
    BACKUP-LOG.tar                   MASTER-LOG.tar                    krt_gencfg_filter.txt
    root@lab:RE0%
         
  14. Perform the steps under the section Export the Archived Logs in order to copy the archived logs to your PC or another source.

  15. IMPORTANT: The archive includes several files. Therefore, specify the actual date/time of the outage to be analyzed when giving the archived logs to your technical support representative. This will help speed up the analysis.

Collecting Logs from 8200 series - Multiple Routing Engines

Note: Collecting the logs should be Initiated from the Master.
  1. Login to the Master Routing Engine.  Here we assume RE0 will be the Master.
  2. root@lab> request routing-engine login master
  3. Enter the following command to archive the /var/log directory of RE0.  The following command will zip (tar) the folder "/var/log" and name the file (RE0-LOG.tar).  It also pushes the zipped file to the Master Routing Engine.  The destination folder remains "/var/tmp".
  4. {master:0}
    root@lab> file archive source /var/log destination re0:/var/tmp/RE0-LOG

  5. Login to the Backup Routing Engine - Here we assume RE1 will be the Backup.
  6. {master:0}
    root@lab> request routing-engine login backup
    root@lab% cli
    {backup:1}

  7. Enter the following command to archive the /var/log directory of the RE1.  The following command will zip (tar) the folder "/var/log" and name the file (RE1-LOG.tar).  It also pushes the zipped file to the Master Routing Engine.  The destination folder remains "/var/tmp".
  8. {backup:1}
    root@lab> file archive source /var/log destination re1:/var/tmp/RE1-LOG

  9. Perform the steps under the section Export the Archive Logs in order to copy the archived logs to your PC or another source.

  10. IMPORTANT:
    The archive includes several files. Therefore, specify the actual date/time of the outage to be analyzed when giving the archived logs to your technical support representative. This will help speed up the analysis.


Export the Archived Logs saved in  "/var/tmp"

Archived logs can be copied (exported) to your PC or another source using either of the following methods:
  • FTP to the Master switch and copy (export) the files from the "/var/tmp" directory
  • JWEB into the switch and Download the desired File (Refer the screenshots)

FTP:
Download the saved Logs on the Junos device or switch through FTP services by performing the following:
  1. Prerequisite:  FTP services must be enabled on the Junos device or switch.  These services are not enabled by default. 

  2. root@ex# set system service ftp
    root@ex# commit


  3. From the FTP client, login into switch (user: root).

  4. Change directory from "/root" to "/var/tmp"

  5. Select the saved File. (Note - As per the above example, the filename could be either LOGS or MASTER-LOG )

  6. Copy the saved file to the desired location by clicking on transfer.



J-Web
  1. Select Maintain > Files

  2. Select Temporary Files in the /var/tmp directory.



  3. Click the checkbox next to the archived file collected above,and then select the Download action.



Related Links: