Support Support Downloads Knowledge Base Service Request 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

[NFX] Examples - Archiving and copying log files

0

0

Article ID: KB32280 KB Last Updated: 30 Nov 2017Version: 1.0
Summary:
This article provides example commands to archive and copy logs files between JDM, JCP, and Hypervisor on NFX250.
Solution:

Below are various archive and copy examples:


Archive all contents of /var/log/ from Hypervisor and move to JDM with a single command:

Execute this command on the Hypervisor:
tar -czvf /var/third-party/hypervisor-CURRENT-DATE.tgz /var/log/*  ( collect this file:hypervisor-CURRENT-DATE.tgz from /var/third-party folder on JDM )

Note: /var/third-party folder is shared between JDM and Hypervisor. This means that you can copy a TAR file in the /var/log folder in Hypervisor to the /var/third-party/ folder, and you can collect that same TAR file in /var/third-party from JDM.
 

Archive and copy /var/log folder from JCP (192.168.1.2) to JDM /var/third-party/ folder while in JDM shell

Tip: Use this option if you have network connectivity from JDM to export logs outside the device.

Execute this command from vJunos0/JCP cli to archive the file:
file archive compress source /var/log/* destination /var/tmp/JCP-CURRENT-DATE.tgz

Execute this command on JDM shell to copy file from JCP /var/tmp location to JDM /var/tmp location: 
scp root@192.168.1.2:/var/tmp/JCP-logs.tgz /var/tmp/

 

Archive and copy /var/log folder from JDM to vjunos0/JCP /var/tmp folder

Tip: Use this option if you have connectivity only from JCP to export the logs from the device   

Execute this command on JDM shell to archive /var/log/ folder on JDM:
tar -czvf /var/tmp/JDM-logs.tgz /var/log/*

Execute this command on JDM shell to copy archived file to JCP/vJunos0:
scp /var/tmp/JDM-logs.tgz 192.168.1.2:/var/tmp/

 

Archive and copy /var/log tar file from hypervisor to vjunos0/JCP /var/tmp folder

Tip: Use this option if you have connectivity only from JCP to export the logs from the device

Execute this command on the hypervisor to archive /var/log folder
tar -czvf /var/tmp/hypervisor-logs /var/log/* 
     
Execute this command on the hypervisor to copy archived file to JCP/vJunos0
scp /var/tmp/hypervisor-logs 192.168.1.2:/var/tmp/
 

Notes:

  1. IP address 192.168.1.2 is an internal management IP address on vJunos0.
  2. Check the /etc/hosts file on the JDM shell to view the mapping of internal management IP address of various components
root@NFX-JDM:/var/third-party# cat /etc/hosts
127.0.0.1       localhost
192.168.1.1     hypervisor
192.168.1.2     vjunos0  <<<<<<<<<<<<<<<<<<<<<<<
192.168.1.3     vjunos1
192.168.1.4     vsrx
192.168.1.254   jdm NFX-JDM
128.0.0.254     jdm NFX-JDM
192.168.1.5     ipsec-nm
192.168.1.100    vSRX-7
192.168.1.101    vSRX-77

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

Security Alerts and Vulnerabilities

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