Checking Logs Directly on the Xinet Server

Overview

There are many ways to investigate the logs for reported issues. The easiest one is to inspect the log file directly on the server using commands such as less, more or cat. In many cases, it is better to actually parse the log content with specific keywords to quickly find the most useful information.

This article details steps to check logs directly on the Xinet server.

Environment

Northplains > Xinet 

Prerequisites

  • Access to the Xinet Server as a sudo user.
  • Remote connection tool

Process

Follow the steps below to check logs on the Xinet Server. We will use venture.log as an example, which gives us information on database errors and warnings.

    1. Log into the Xinet Server from the terminal via SSH (Secure Shell) as a sudo user.

    2. Navigate to the directory containing the file venture.log by entering the following command :

      • cd /usr/adm/appletalk.

    3. Use the following commands to open & review the log file venture.log:
      1. The less command:

        • Enter the command: less venture.log // an output similar to the one shown in Image-1.0 will be displayed:

          mceclip0.png
          Image-1.0

        • Use the cursor up and down arrow keys on the keyboard to move one line up or down in the file contents, if it is larger than what is presented on the screen.

        • Press Shift+G keys together on the keyword to go to the bottom of the log file (the most recent entries appear here).

        • Press the G key twice on the keyboard to go back to the top of the file.

        • To exit from the less command's output, press the Q key.

      2. The more command:

        • more venture.log  // You can page down to review file contents using the more, but it doesn't support to scroll backward in the file, which is the main difference between more and less(which has been later introduced in Unix/Linux systems to resolve this limitation).

      3. The cat command:

        • cat venture.log //print file contents in the shell console.

        • An output similar to the one shown in Image-2.0 will be displayed:

          _2019-07-02_19-25-38.png
          Image-2.0

      4. The grep command with the shell mechanism called I/O pipe to filter only specific lines of the log file you are investigating for example:

        • cat venture.log | grep backup // shows information related to the backup operations logged in the venture.log file.

        • cat venture.log | grep fail // shows information related to the backup failures logged in the venture.log file.

        • cat venture.log | grep sync // shows information related to the volume sync in the venture.log file.
        • cat venture.log | grep licen // shows information related to the license related entries in the venture.log file.
        • Refer to the Image-2.1 for the sample output of the above commands.

          _2019-07-03_11-32-33.png
          Image-2.1
      5. The grep command with -i option:
        • Example command1: cat venture.log | grep backup
        • Example command2: cat venture.log | grep -i backup // ignores case sensitive matching. This will match every word regardless if it is uppercase or lowercase.
        • Refer to the Image-2.2 for the sample output of the above commands. In these examples, without ignoring case sensitivity we do not get any match for the error string (example command1), but we do with -i option (example command2):

          mceclip1.png
          Image-2.2

Note: Using a combination of cat, pipe, and grep command is a very common method of looking for the problems reported in error logs, especially if we know that words like error, fail, or warning will be shown in the log.

Comments

0 comments

Article is closed for comments.