Knowledge Search


×
 

[QFX5100] How to collect logs from the host shell

  [KB30772] Show Article Properties


Summary:

This article describes how to collect logs on a QFX5100 from the host shell.

Symptoms:

Sometimes it is required to check and copy logs on a QFX5100 from host for troubleshooting purposes.
Notes:

  • To get into the host shell and collect the host logs, you need the root password.
  •  It is not necessary to collect the logs from host shell for every issue. Collect these only when advised by JTAC.

For the recommended logs to collect when opening a case, refer to KB26813 - [EX /QFX] Data Collection Checklist - Logs/data to collect for troubleshooting.

Solution:

Perform the following steps:

  1. Log in to the shell of the host:
    {master:0}
    root@qfx5100> request app-engine ?
    Possible completions:
    cleanup Compute node cleanup /var/tmp and /var/log
    file-copy Copy file from host to vjunos
    offline Shutdown compute node
    reboot Reboot compute node/virtual-machine
    service Start/stop/restart compute node service
    {master:0}

    root@qfx5100> request app-engine host-shell >>>>>>>>>> login to host shell with root user
    Last login: Thu Feb 4 11:14:34 from 192.168.1.2
    --- Host 13.2X51-D30_vjunos. built 2014-11-28 09:41:27 UTC
    -sh-4.1#
    -sh-4.1#
    -sh-4.1#
    -sh-4.1#

     
  2. Zip all the files from the /var/log directory to the file host-logs.tar under /var/log/:
    -sh-4.1# tar -cvf /var/log/host-logs.tar /var/log
    tar: Removing leading `/' from member names
    /var/log/
    /var/log/dmesg.old
    /var/log/messages
    /var/log/wtmp
    /var/log/dmesg
    /var/log/libvirt/
    /var/log/libvirt/lxc/
    /var/log/libvirt/qemu/
    /var/log/libvirt/qemu/vjunos0.log
    /var/log/libvirt/libvirtd.log
    /var/log/libvirt/uml/
    /var/log/stap-server/
    /var/log/stap-server/log
    /var/log/host-logs.log
    /var/log/named.log
    /var/log/tallylog
    /var/log/lastlog
    /var/log/maillog
    /var/log/ntpstats/
    /var/log/btmp
    /var/log/spooler
    /var/log/cron
    /var/log/boot.log
    /var/log/audit/
    /var/log/secure
    /var/log/sa/
    /var/log/sa/sar30
    /var/log/sa/sa07
    /var/log/sa/sa08
    /var/log/sa/sa03
    /var/log/sa/sar04
    /var/log/sa/sar07
    /var/log/sa/sa06
    /var/log/sa/sa31
    /var/log/sa/sar06
    /var/log/sa/sar02
    /var/log/sa/sar31
    /var/log/sa/sa02
    /var/log/sa/sa01
    /var/log/sa/sar05
    /var/log/sa/sa04
    /var/log/sa/sar01
    /var/log/sa/sar03
    /var/log/sa/sa05
    /var/log/watchdog/

  3. Check if the file was created correctly:
    -sh-4.1# ls -al /var/log
    total 101920
    drwxr-xr-x 8 root root 4096 Feb 8 13:52 .
    drwxr-xr-x 24 root root 4096 Jan 13 20:15 ..
    drwxr-xr-x 2 root root 4096 Oct 8 2014 audit
    -rw------- 1 root root 0 Dec 8 00:37 boot.log
    -rw-r--r-- 1 root root 0 Oct 9 2014 btmp
    -rw------- 1 root root 19965658 Feb 8 13:52 cron
    -rw-r--r-- 1 root root 39791 Jan 13 20:07 dmesg
    -rw-r--r-- 1 root root 39791 Jan 13 19:48 dmesg.old
    -rw-r--r-- 1 root root 56197120 Feb 8 13:52 host-logs.tar >>>>>>>>>>>>>>>>>>>
    -rw-r--r-- 1 root root 292 Feb 8 13:51 lastlog
    drwxr-xr-x 5 root root 4096 Dec 8 00:37 libvirt
    -rw------- 1 root root 0 Dec 8 00:37 maillog
    -rw-r--r-- 1 root root 838524 Feb 8 13:51 messages
    -rw-r--r-- 1 root root 0 Oct 8 2014 named.log
    drwxr-xr-x 2 root root 4096 Oct 9 2014 ntpstats
    drwxr-xr-x 2 root root 4096 Feb 8 00:00 sa
    -rw------- 1 root root 6811 Feb 8 13:51 secure
    -rw------- 1 root root 0 Dec 8 00:37 spooler
    drwxr-xr-x 2 root root 4096 Dec 8 00:34 stap-server
    -rw------- 1 root root 0 Oct 9 2014 tallylog
    drwxr-x--- 2 root root 4096 Dec 8 00:37 watchdog
    -rw-rw-r-- 1 root utmp 34176 Feb 8 13:51 wtmp
    -sh-4.1# exitrlogin: connection closed

  4. Copy the file from host to the Junos VM.
    {master:0}
    root@qfx5100> request app-engine file-copy from-jhost host-logs.tar to-vjunos /var/tmp log

  5. Check if the file was transferred.  From there you can copy the file to a remote server.
    {master:0}
    root@qfx5100> file list /var/tmp detail

    /var/tmp:
    total blocks: 162988
    drwxrwxr-x 2 root wheel 512 Jul 3 2014 .snap/
    drwxr-xr-x 2 root field 512 Dec 8 00:38 gres-tp/
    -rw-r--r-- 1 root field 56197120 Feb 8 13:54 host-logs.tar >>>>>>>>>>>>>>>>
    drwxrwxrwx 2 root wheel 512 Dec 8 00:38 install/
    drwxrwxrwx 2 root wheel 512 Dec 8 00:38 pics/
    -r--r--r-- 1 root field 604 Dec 8 00:31 preinstall_boot_loader.conf
    drwxr-xr-x 2 root field 512 Dec 8 00:38 rtsdb/
    -rw-r----- 1 root field 1602 Jan 13 20:15 sampled.pkts
    -rw-r--r-- 1 root field 0 Jan 13 20:15 stable
    drwxrwxrwt 2 root wheel 512 Dec 8 00:38 vi.recover/
    -rw-r--r-- 1 root field 42 Dec 8 00:32 vjunos-install.log
    total files: 6
Modification History:
2019-05-18: Added note to 'Symptoms' section.
Related Links: