Description

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.

(Note: This article replaces deprecated article ID: KB15400 [juniper.net])

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 primary switch of the EX Virtual Chassis. In this example, member 0 is the primary switch.

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

    user@router> 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 Primary 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 primary.

    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 primary 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 Primary switch.

    root> exit
  13. Repeat steps 6 through 12 by changing the member id until all the member logs are loaded to the primary 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 primary 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.

Modification History

2024-05-22: Minor non-technical change.
2021-03-24: Updated the article terminology to align with Juniper's Inclusion & Diversity initiatives.
2020-02-13: Article reviewed for accuracy; no changes required.

Related Information