Support Support Downloads Knowledge Base Case Manager My Juniper 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

How to collect /var/log files from all members of an EX Switch Virtual Chassis (VC) using the tar command

1

0

Article ID: KB15186 KB Last Updated: 14 Feb 2020Version: 7.0
Summary:

This article describes how to collect log files from the /var/log folder of all the member switches in a Virtual Chassis (VC) environment using the tar method. The log files in the /var/log directory are required by Juniper Technical Support (JTAC) to analyze issues that are reported to Juniper Support.

Symptoms:

The /var/log files can be collected using the tar method or the file archive compress method. This article provides the instructions using the tar method.

For an alternate, simpler method using file archive compress, refer to:

Solution:

Follow the steps below to collect all the files from the /var/log directory of each member of a virtual chassis.

NOTE: You will need FTP, SSH, HTTP (JWEB) or USB access to the EX Switch to copy the logs from the Switch.

  1. Login to the EX Virtual Chassis (VC) using the management IP address or console. You will be logged into the master switch of the EX Virtual Chassis. In this example, member 0 is the Master switch.

    {master:0}
    user@juniper>
  2. Login to the shell prompt as the root user.

    user@juniper> start shell user root
  3. Use the "tar" command to compress the folder /var/log and its contents.  The file will be saved to /var/tmp directory

    root% tar -zcvf /var/tmp/varlog-mem0.tar.gz /var/log/*
  4. Verify whether the tar.gz file has been created

    root% ls /var/tmp
    .ssh varlog-mem0.tar.gz
  5. Exit from the shell prompt using the command "exit" and you will be placed on the CLI prompt of Master switch

    {master:0}
    root% exit
  6. Request a session to the next member of the virtual chassis using its member ID.  To verify which member you are connected to, use the "show virtual chassis" command and it will display an asterisk * next to the member you are connected to.

    root> request session member 1
  7. Login to the shell as the root user

    root> start shell user root
  8. Use the "tar" command to compress the folder /var/log and its contents.

    root% tar -zcvf /var/tmp/varlog-mem1.tar.gz /var/log/*
  9. Verify whether the tar.gz file has been created

    root% ls /var/tmp
    .ssh varlog-mem1.tar.gz
  10. Go to the CLI of current member to copy the member log files to master.

    root% cli
  11. Execute the file copy command to copy the tar.gz file from the current member switch to the /var/tmp directory on master switch

    root> file copy fpc1:/var/tmp/varlog-mem1.tar.gz fpc0:/var/tmp/
  12. Exit from the current member session. Now you will be logged back into the master switch.

    root> exit
  13. Repeat steps 6 through 12 by changing the member id until all the member logs are loaded to the master switch.

    Be sure to name each file according the member id to easily identify.

Now the files can be directly copied from the EX Virtual Chassis master to any local host using ftp, scp, JWEB, or mounted USB.

NOTE: FTP, SSH and HTTP are configured under the 'system services' stanza.  See Related Links below.

Related Links

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