How to collect logs from an edge device with a USB drive

Introduction

When your edge devices have poor network connectivity, they may not be able to send log data to your enterprise. When this happens, you can collect your logs manually using a USB drive. This article describes how to do so.

Procedure

Create a USB stick to dump the logs

  1. Download the EVE tools from GitHub to a chosen directory:
  2. Navigate to your new EVE directory:
    • cd eve
  3. Create the USB image:
    • On Linux:
      1. Get the name of the USB device (/dev/sdx in this example). Run:
        • lsblk
      2. Create the USB image. Run:
        • tools/makeusbconf.sh -d -i -s 8192 /dev/sdx
    • On macOS:
      1. Place the USB image in a image file. Run:
        • tools/makeusbconf.sh -d -i -s 8192 usb.img
      2. Copy the usb.img image file to the raw USB disk device using a flashing utility of your choice.
    • On Windows:
      • Run below command, and it will ask you for a USB device to use.
        • tools/makeusbconf.bat

Note: The following error message can be ignored. It does not affect the final OS image build. Find more information on https://github.com/lf-edge/eve/issues/2570.

"tools/makeusbconf.sh: line 10: linuxkit: command not found"

 

Dump the logs into the USB stick

Capturing the log files:

  1. Plug the USB into the Edge Device. Any port is fine.
  2. Wait 10 minutes for all the diags to be written into the USB.
  3. Unplug the USB (no need to power down the device) and plug it into your machine.
  4. There will be a partition named "EVEDPC" with two directories called "dump" and "identity".
  5. Provide the file called diag.tar inside the directory "dump" to ZEDEDA support.

Note: This works out of the box before the device is onboarded. After on-boarding, however, it is required to enable USB ports using the following zcli command:

zcli edge-node update <EDGE_NODE> --config="debug.enable.usb:true"

 

Additional Information

Using 'makeusbconf.sh'

makeusbconf.sh [-d] [-i] [-s <size in Kb>] [-f <file> ] <output.img>
  • -d
    • Create a directory called 'dump' inside the partition, which Eve will use to deposit any diagnostics like the log files.
  • -i
    • Create a directory called 'identity' inside the partition, which Eve will use to deposit its identity like the device certificate.
  • -s
    • 8192 Set the size of the image to 8MiB (the default size is 200MiB, which is unnecessarily large for this case).
  • -f
    • Provide an input file with with a network config override in json format (this flag is not required to obtain logs).
  • The script outputs the output.img file to the current working directory.

 

 

Was this article helpful?
0 out of 0 found this helpful