Support Support Downloads Knowledge Base Apex Support Portal Community

Knowledge Base

Search our Knowledge Base sites to find answers to your questions.

Ask All Knowledge Base Sites All Knowledge Base Sites JunosE Defect (KA)Knowledge BaseSecurity AdvisoriesTechnical BulletinsTechnotes Sign in to display secure content and recently viewed articles

[EX] Collecting logs from EX devices using "file archive" command

0

0

Article ID: KB20569 KB Last Updated: 08 Apr 2021Version: 4.0
Summary:

This article details the logs that you must collect from EX Series devices, which may play a vital role in Root Cause Analysis (RCA).

Symptoms:

Collect all relevant and required logs on EX devices using the file archive command. The file archive command provides a simple way to zip (tar) files.

Solution:

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

 

Collecting Logs from a Stand-alone switch

  1. Log in 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 will also push the zipped file to the destination folder "/var/tmp".

root@lab> file archive source /var/log destination /var/tmp/LOGS
  1. Perform the steps under the section Export the Archived Logs in order to copy the archived logs to your PC or another source.

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: Collection of logs should be initiated from the primary device.

  1. Log in to the primary device. Here we assume that FPC0 is the primary device.

  2. Enter the following command to archive the /var/log directory of the primary device. The following command will zip (tar) the folder "/var/log" and name the file (MASTER-LOG.tar). It will also push the zipped file to the primary switch. The destination folder remains "/var/tmp".

{master:0}
root@lab> file archive source /var/log destination fpc0:/var/tmp/MASTER-LOG
  1. Log in to the backup device. Here we assume that FPC1 is the backup device and FPC0 remains the primary device.

{master:0}
root@lab> request session member <Member ID>    (For FPC1 it will be 1)
root@lab% cli
{backup:1}
  1. Enter the following command to archive the /var/log directory of the backup device. The following command will zip (tar) the folder "/var/log" and name the file (BACKUP-LOG.tar). It will also push the zipped file to the primary switch (FPC0). The destination folder remains "/var/tmp".

{backup:1}
root@lab> file archive source /var/log destination fpc0:/var/tmp/BACKUP-LOG
  1. Log in to the other linecard members. Here we assume that FPC2 will be the other linecard member, whereas FPC0 remains the primary device. (Replace FPC2 with the respective member ID.)

{backup:1}
root@lab> request session member 2    (For FPC2 it will be 2)
root@lab% cli
{backup:2}
  1. 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 will also push the zipped file to the primary switch. The destination folder remains "/var/tmp".

root@lab> file archive source /var/log destination fpc0:/var/tmp/LC-FPC2-LOG
  1. Log in to the primary device and make sure that the desired files have been saved in the /var/tmp directory:

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%    
  1. Perform the steps under the section Exporting the Archived Logs in order to copy the archived logs to your PC or another source.

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: Collection of logs should be Initiated from the primary device.

  1. Log in to the primary Routing Engine. Here we assume that RE0 will be the primary device.

root@lab> request routing-engine login master
  1. 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 will also push the zipped file to the primary Routing Engine. The destination folder remains "/var/tmp".

{master:0}
root@lab> file archive source /var/log destination re0:/var/tmp/RE0-LOG
  1. Log in to the backup Routing Engine. Here we assume that RE1 will be the backup device.

{master:0}
root@lab> request routing-engine login backup
root@lab% cli
{backup:1}
  1. 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 will also push the zipped file to the primary Routing Engine. The destination folder remains "/var/tmp".

{backup:1}
root@lab> file archive source /var/log destination re1:/var/tmp/RE1-LOG
  1. Perform the steps under the section Exporting the Archive Logs in order to copy the archived logs to your PC or another source.

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.

 

Exporting 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 primary switch and copy (export) the files from the "/var/tmp" directory.

  • Use J-Web to log in to the switch and download the desired file (refer to the screenshots).

FTP

Download the saved logs on the device that is running Junos OS or switch through FTP services by performing the following:

  1. Prerequisite: FTP services must be enabled on the device or switch. These services are not enabled by default. 

root@ex# set system service ftp
root@ex# commit 
  1. From the FTP client, log in to the switch (user: root).

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

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

  4. Copy the saved file to the desired location by clicking Transfer.

J-Web

  1. Select Maintain > Files.

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

  1. Select the check box next to the archived file collected above, and then click the Download action.

Modification History:

2021-04-08: Updated the article terminology to align with Juniper's Inclusion & Diversity initiative

Comment on this article > Affected Products Browse the Knowledge Base for more articles related to these product categories. Select a category to begin.

Getting Up and Running with Junos

Getting Up and Running with Junos Security Alerts and Vulnerabilities Product Alerts and Software Release Notices Problem Report (PR) Search Tool EOL Notices and Bulletins JTAC User Guide Customer Care User Guide Pathfinder SRX High Availability Configurator SRX VPN Configurator Training Courses and Videos End User Licence Agreement Global Search