Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

Compressing Troubleshooting Logs from /var/logs to Send to Juniper Networks Technical Support

 

Problem:

Description: You have collected logs on your device and need to send them to Juniper Networks Technical Support. This topic shows you how to compress the logs into a single file for each Routing Engine to more conveniently send the logs.

Solution

You can compress all the log files in the /var/log directories of the master and backup (if present) Routing Engines into a single tgz file for each Routing Engine, which enables you to send the logs to JTAC in a convenient package. You can use either the CLI or the command shell to perform these tasks; because of its ease of use, only the CLI version is shown here.

  1. Access the device through the management IP address or console, typically on the master Routing Engine, RE0.
    user@host>
  2. Archive and compress all the log files on RE0 and put them in /var/tmp.
    user@host> file archive compress source /var/log/* destination /var/tmp/re0.tgz
    /usr/bin/tar: Removing leading `/' from member names
  3. Confirm that the compressed archive file has been created.
    user@host> file list /var/tmp

    On devices with a single Routing Engine, skip to Step 10.

  4. Log in to the backup Routing Engine, RE1, and access the CLI.Note

    1 is appended to the hostname in the prompt to signify that you are on RE1.

    user@host> request routing-engine login backup
    % cli
  5. Archive and compress all the log files on RE1 and put them in /var/tmp.
    user@host1> file archive compress source /var/log/* destination /var/tmp/re1.tgz
    /usr/bin/tar: Removing leading `/' from member names
  6. Confirm that the compressed archive file has been created.
    user@host1> file list /var/tmp
  7. Exit the remote login to the backup Routing Engine to return to the master Routing Engine. Note that the previously appended 1 is removed from the hostname in the prompt to signify that you are back on RE0.
    user@host1> exit
  8. Copy the compressed archive file from RE1 to RE0.
    user@host> file copy re1:/var/tmp/re1.tgz /var/tmp
  9. Confirm the presence of the copied file.
    user@host> file list /var/tmp
  10. Copy the files directly from the master Routing Engine to any local host using FTP, SCP, JWEB, or (on some devices) a mounted USB.