Issue:

If you are having problems during imaging you will often be asked to upload a copy of the zim.log file to our website to help us resolve the problem, however getting the log from the imaging environment is not always straightforward.

Solution:

From Imaging Toolkit 9.0.2 and Deployment Monitor 1.0.4 onwards the zim and ztoolkit logs are automatically collected, and are available via the Deployment Monitor web console. If you have chosen not to use Deployment Monitor this document will take you through several methods of extracting the zim.log file from the imaging environment.

Requirements:

  • For ZENworks imaging:

    • Media to extract the zim.log file to: USB device, FTP Server, TFTP server or CIFS share

    • An understanding of basic Linux commands

  • For WinPE imaging:

    • Media or network share to copy the zim.log file to

Procedure:

NOTE:It is important that you reproduce the problem after enabling logging, otherwise the zim.log will not show the correct information

Select the imaging environment in use to see the appropriate procedures:


1.ZENworks Linux/zmg imaging
2.WinPE/wim imaging

  1. ZENworks Linux/zmg imaging

    For ZENworks Linux/zmg imaging the following tasks must be completed in order to extract a debug zim.log file

    DoneTask
     
    1.Enable debug logging
     
    2.Extract log file
    1. Enable debug logging

      To enable debug logging run Zim with the command line

       ./zim -lic:/zimbin/engl.lic -s:/zimbin/zim.cfg -log -z

      This can be achieved by modifying the zimrun.s file in the zimfiles directory on your TFTP server.
       Zim will run as normal but will also create a log file, /zimbin/zim.log, and does not block the ability to press "Control + C" to break out of Zim to the bash prompt. 

      Create the log file as follows;

      • Follow the steps you normally take for the error to appear but ensure that Restart after imaging is not enabled.

        NOTE:DO NOT REBOOT the machine as the log file is written to the imaging environment's RAM disk
      • Select [Maintenance Menu] -> [Exit to prompt] or press [Control] + [c] to break to the bash prompt
    2. There should now be a zim.log file in the /zimbin folder. To view this file type

      less zim.log
      NOTE:To exit from the "less" command - press [q]
    3. Extract the zim.log file

      There are several ways to copy the zim.log to more accessible media. Below are some of the most common options, select the one which is most appropriate to your environment:

      DoneTask
       
      1.USB Device
       
      2.FTP Server
       
      3.TFTP Server
       
      4.CIFS share
      1. USB Device

        1. Identify the USB device.

          1. At the bash prompt type 
             cat /proc/partitions
          2. Make a note of the devices listed
          3. Insert a USB pendrive/disk into the machine with the zim.log file
          4. At the bash prompt type 
             cat /proc/partitions
             There should now be an extra device loaded which is likely to be /dev/sda1 if the main harddisk is an IDE hard drive or /dev/sdb1 if the main harddisk is a SCSI or SATA drive
        2. Mount the USB drive by typing 
           mount /dev/<mount point> /mnt
           Where <mount point> is sda1 or sdb2  as noted above. This will make the USB Device accessible
        3. Copy the log file onto the USB Device 
           cp /zimbin/zim.log /mnt
        4. un-mount the USB Device from the Linux environment 
           umount /mnt
        5. Remove the USB Device and attach the zim.log file to your support ticket
      2. FTP Server

        1. To launch the FTP client type the following at the bash prompt
           ftp
        2. Connect to the appropriate FTP server by typing 
          open <server ip address or dnsname>
        3. If prompted enter your username and password
        4. Once connected type 
           put /zimbin/zim.log /<path>/zim.log
           Where <path> is the path to upload the file to - check with your FTP server administrator
        5. Exit from the FTP client by typing 
           quit
        6. The zim.log file from the workstation should now be on the FTP server and can be attached to your support ticket
      3. TFTP Server

        1. The ZENworks TFTP server is used to boot to the Linux imaging environment. By default (and for security reasons) the TFTP server is configured to block TFTP uploads, so in order to upload the zim.log file it is necessary to enable uploads to the TFTP server.

           See Deploying and Managing Preboot Services for instructions on configuring the TFTP server with ZENworks 11
        2. Once the TFTP upload has been configured and the TFTP service has been restarted, at the bash prompt type 
           tftp $PROXYADDR
           put /zimbin/zim.log /log/zim.log
           quit
        3. The zim.log file should now be on your imaging server and can be attached to your support ticket
      4. CIFS share

        The ZENworks imaging environment can mount a CIFS share to a local mount point. This can be used to copy the zim.log file off of the machine.

        1. Identify the share that you wish to connect to and make a note of suitable credentials

           For example:   
          servershareusernamePassword
          labsrv.engllab.locallogsengllab\builduser-adP@ssw0rd
        2. At the bash prompt create a suitable mount point: 
           mkdir /mnt/logs
        3. Mount the CIFS share to the newly created mount point 
           mount.cifs //labsrv.engllab.local/logs /mnt/logs -o username=engllab\builduser-ad,password=P@ssw0rd
        4. Copy the log file onto the CIFS share 
           cp /zimbin/zim.log /mnt/logs/
        5. Un-mount the CIFS share from the imaging environment 
           umount /mnt/logs
        6. Attach the zim.log file to a support ticket update
  2. WinPE/wim imaging

    To enable debug logging run Zim with the command line

     zim.exe /log /z

    This can be achieved by modifying the zimpeget.cmd file in the zimfiles directory on your TFTP server.
     Zim will run as normal but will also create a log file, zim.log, and does not block the ability to press "Control + C" to break out of Zim to the bash prompt. 

    Create the log file as follows;

    • Follow the steps you normally take for the error to appear but ensure that Restart after imaging is not enabled.

      NOTE:DO NOT REBOOT the machine as the log file is written to the imaging environment's RAM disk
    • Select [Maintenance Menu] -> [Exit to prompt] or press [Control] + [c] to break to the bash prompt
  3. There should now be a zim.log file in the current directory. Copy the file to a suitable location, for example to a USB device, or to a Windows share (by issuing a net use command).

    Attach the zim.log file to a support ticket update


If you have any problems or questions about the steps in this TID please contact the ENGL support team