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

[MX/PTX] How to collect /var/log files from Next Generation Routing Engine (NG-RE)

0

1

Article ID: KB31910 KB Last Updated: 20 Mar 2020Version: 6.0
Summary:

This article describes how to collect log files from both Junos OS VM and Linux based host (VMHost) in a Next Generation Routing Engine (NG-RE) hardware. The log files in the /var/log directory are required by Juniper Technical Assistance Center (JTAC) to analyze any reported incident and tracked in a JTAC Service Request.

Solution:

NG-RE is a new RE model sharing common infrastructure for multiple platforms such as MX and PTX.

NG-RE models:

  • RE-S-X6-64G: 6-core Haswell CPU, Wellsburg PCH based routing engine with 64GB DRAM and 2x 64GB SSD storage for MX240/MX480/MX960

  • REMX2K-X8-64G: 8-core Haswell CPU, Wellsburg PCH based routing engine with 64GB DRAM and 2x 64GB SSD storage for MX2020 and MX2010

  • RE-PTX-X8-64G/CB2-PTX: 8-core Haswell CPU, Wellsburg PCH based routing engine with 64GB DRAM and 2x 64GB SSD storage for PTX5K​

  • ​RE-PTX-2X00x4(JNP10K-RE0) : 4-core Intel IVY Bridge CPU, Wellsburg PCH based routing engine with 32GB DRAM and 2x 50GB SSD storage for PTX10K

  • RE X10 (JNP10K-RE1) : 10-core Intel Broadwell-EP CPU, Wellsburg PCH based routing engine with 64GB DRAM and 2x 200G SSD storage for PTX10K

The NG-RE has a virtualized architecture where Junos OS runs as a virtual machine over a Linux based host (VMHost). When the system boots, Junos OS is automatically launched. At the end of the boot, a login prompt is seen. The NG-RE is based on the popular hypervisor/emulator combination of kvm/qemu.

Junos OS is the only VM operating in the administrative context, although the scope is available for expansion with other VMs in the future.

In NGRE, there are two levels of /var/log to be collected for JTAC analysis:

  1. Junos OS VM
  2. Linux based host (VMHost)

Steps to collect /var/log:

  1. Junos OS VM

    Use the following command to zip all files under /var/log and dump it as /var/tmp/re-0-var-log.tgz

    lab> file archive compress source /var/log/* destination /var/tmp/re-0-var-log.tgz
    
    
  2. Linux based host (VMHost)
    1. Log in to shell.

      labroot> start shell
      % su
      Password:

    2. Log in to host.

      root@:/var/home/lab # vhclient -s     
      Last login: Wed Mar  1 19:34:22 CST 2017 from local-node on pts/1

    3. Zip the content.

      root@local-node:~# tar -cf ~/host_varlog_RE0.tar -C /var/log/*
      tar: Removing leading `/' from member names
      root@local-node:~# ls -l | grep varlog
      -rw-r--r--. 1 root root 75509760 Jun 22 02:55 host_varlog_RE0.tar

    4. Copy the file to VM Routing Engine /var/tmp.

      -- PTX10K systems --
      root@ptx10008-re0-node:~# scp host_varlog_RE0.tar root@192.168.1.2:/var/tmp/
      Password:
      host_varlog_RE0.tar                            100%   54MB  26.8MB/s   00:02


      -- MX systems & PTX5K systems --
      root@mx2008-re0-node:~# scp host_varlog_RE0.tar root@192.168.1.1:/var/tmp/
      Password:
      host_varlog_RE0.tar                            100%   73MB  36.5MB/s   00:02

    5. You can also directly copy the host logs, collected in step (c) above, from the CLI by using the following commands:
      > request vmhost file-copy from-jnode host-logs.tar to-vjunos /var/tmp/host_varlog_RE0.tar log 
      Note: In order perform the file copy operation from VMHOST to Junos (Step 2d) possible, users should be allowed to log in to the router via SSH as "root":
      [edit]
      +  system {
      +      services {
      +          ssh {
      +              root-login allow;
      +          }
      +      }
      +  }
      
      

Now the files can be directly copied from Routing Engine to any local host using FTP, SCP, J-Web, or mounted USB.

Note: FTP, SSH and HTTP are configured under the system services stanza.

Modification History:

2020-03-19: Added step 2e.
2019-11-11: Minor correction in solution in step 2a
2019-06-07: Modified step 2d, providing different commands for PTX and MX. Added a note regarding ssh/root login.
2017-09-23: Minor correction for step 2d.

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