Installing and managing Docker connector


To derive insights from logs and troubleshoot issues by analyzing the logs, start with log collection. To collect logs from applications running on docker containers, download and install Docker connector.

The following image shows the list of tasks that you can perform for the connector:

DockerConnectorOperations.png


Before you begin

  • Make sure that the host computer on which you plan to install the connector has a 2-core CPU and 16 GB RAM.
  • Make sure that you are downloading and installing the connector on one of the following operating systems:
    • RHEL 8.x, 7.x
    • CentOS 8.x, 7.x
    • Ubuntu 20.x, 18.x
  • Make sure that you have installed docker version 18.01 or later.


To download and install a connector

  1. From the Collection menu, select Connectors.
  2. On the Connectors page, click Create.
  3. To add connector details, perform the following steps:
    1. In the Connector Name field, enter a unique name for the connector.
    2. From the Select Connector Type list, select Docker Connector.
    3. In the Description field, enter description of the connector.
  4. In the Download Connector step, click Download.
  5. In the Tags step, add tags (in the form of key-value pairs) to identify the connector, for example, name-windows, location-Pune, and so on.
  6. In the Download Install Script step, click Download.
    The format of the 
    .sh file name is install-connector-<connector name>.sh. For example, if you entered the connector name as my-bmc, the .sh filename is install-connector-my-bmc.sh.
  7. To communicate with the connector through a proxy server, perform the following steps:
    1. Open the installation script (example: install-connector-my-bmc.sh).
    2. Locate the following command line: “echo 'FLUENTD_LOG_SIZE_BYTE=10000000' >> $ENV_VARIABLE_FILE_PATH”.
    3. Before this line, add the following command line:
      echo 'HTTP_PROXY=http://<proxy server>' >> $ENV_VARIABLE_FILE_PATH
    4. Save the file.
      ImportantThe connector communicates with the proxy over the HTTP protocol only.
  8. Copy the downloaded script and docker image file to the same folder on a docker-enabled server. 
  9. (Optional) To collect logs from files that are located outside the container, in the downloaded script, locate the docker create command statement and create mount points for the log directories.
    For example, if logs are generated in the /var/logs directory on the host filesystem, create a mount point by adding the following argument to the docker create command statement: -v /var/logs/:/fluentd/etc/log/.
  10. Grant the execute permission to the downloaded script, and then run the script.
    For example, run the following commands:
    chmod +x install-connector-my-bmc.sh
    ./install-connector-my-bmc.sh

    Important: Script security and location

    • Do not copy the script on any public domains.
    • Copy the downloaded script in the same location as that of the docker image.
    • Download the connector on a docker host that can communicate with the integration source and BMC Helix APIs.

    To view the container logs, see the /opt/bmc/connectors/<connector_name>/logs/fluent.log file.


To verify the connector installation

To verify the connector installation, go to the Collection menu and click Connectors, and look for the installed connector on the page. Connectors are available in one of the following status:

  • Created: The connector was installed successfully, but has not started sending heartbeats.
  • Active: The connector is sending heartbeats.
  • Suspended: The connector has not sent heartbeats for a pre-configured time. You can delete a connector only in this status.


To find the container ID for a connector

  1. On the server where you installed the connector, open the command line interface.
  2. Run the following command:
    docker ps
    The following image shows a sample container ID:
    container_id_highlight.png

    The output of this command displays the following information:
    • The docker container ID
    • The build name
    • The command to run the docker container (that is /run.sh)
    • The docker container creation timeline
    • The docker container status and the timeline of the status
    • The ports used by the docker container
    • The connector name
      If multiple connectors are present on the container, they are all listed.


To reload a connector

  1. Run the following command:
    docker ps
  2. Log in to the docker container and reload the connector by running the following command:

    docker exec -it <containerID> bash reload.sh


To start and stop a connector

  • To start a connector, run the following command:
    docker start <containerID>
  • To stop a connector, run the following command:
    docker stop <containerID>


To delete a connector

  1. Make sure that the connector is not associated with a collection policy.
  2. Stop the connector and wait for 5 minutes.
    When you stop the connector, its status changes to Suspended.
  3. On the Connector page, for the required connector, click the Actions menu and select Delete.
    If you deleted the connector from the virtual machine before deleting it from the Connectors page, use the Force Delete option to remove the connector from BMC Helix Log Analytics.
  4. Confirm deletion by clicking Yes
  5. Delete the docker container from the computer where you had installed it. 


Where to go from here

Creating-a-parsing-rule

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*