WHERE DO I START?
You are here:Integrations > Linux > Linux Additional Information
  • Top ↑

Linux Additional Information

Relevant Topic(s)   

Linux Agent Docker Container Installation

Setting up the Linux agent Docker container is a two step process:

  1. Copy the unique API key from the Docker integration in your account.
  2. Install the Linux agent Docker container.

Step 1: Copy the API key from the Docker integration in your account

  1. From the top navigation menu, select Integrations.
  2. Click the Docker card. Data Collection should be enabled. A unique API key for your account has already been generated.
  3. Highlight the one-line install command from the instructions and copy them. A unique API key for your account has already been generated and included in the command line.

    The command will run a container named netuitive-agent in the background and publish the port values to the host. It will then set the environment variable DOCKER_HOSTNAME and APIKEY to the described values. Lastly, a volume will be mounted so the agent has access to the Docker API.

    Tip   You can also copy the line below and paste it into your command line. Ensure you replace <my-api-key> with your API key from Netuitive and <my-docker-host> with the desired hostname. Additional environment variables are located in the drop-down below if you'd like to include more or edit existing ones.
    docker run -d -p 8125:8125/udp --name netuitive-agent -e DOCKER_HOSTNAME="<my-docker-host>" -e APIKEY="<my-api-key>" -v /proc:/host_proc:ro -v /var/run/docker.sock:/var/run/docker.sock:ro netuitive/docker-agent

Step 2: Installing the Linux agent Docker Container

  1. Paste the command from 1.3 into your command line. Replace my-docker-host in the command with the name of the docker host. The command will install the agent and add your account's unique API key to the configuration file.
  2. Optionally, navigate to the Linux agent configuration file (typically found at /opt/netuitive-agent/conf/netuitive-agent.conf) and add a metrics blacklist or whitelist under the [[NetuitiveDockerCollector]] section to reduce the number of metrics you receive.

    Regex Examples

    • Escape special regex characters (e.g., ., *, /, etc.) using a /. The following would match containers.*.blkio. metrics and exclude them from collection. For a list of special regex characters you may have to escape, consult this page.
      metrics_blacklist = containers\..*\.blkio\..*
    • Match multiple containers between ( ) and separated by |. The following would match any of the following container IDs and exclude them from collection: abcdef123456, 123456abcdef, ghijkl789012.
      metrics_blacklist = containers\.(abcdef123456|123456abcdef|ghijkl789012)\..*

Additional Documented Collectors and Plugins

Since the Linux agent is a forked branch of the Diamond project on GitHub, all the Diamond plugins/collectors are available to users who have the Linux agent installed. Certain collectors have been documented and optimized by Netuitive staff to get the most out of your Netuitive account; go here to find out which ones are available.

Additional Community Collectors and Plugins

For an exhaustive list of all the collectors available in the community, a description of each collector, and the collector's dependencies, options, and example output, check out the Diamond documentation.

 

Troubleshooting

  1. Copy the command below and paste it into your command line interface to zip up your agent configurations, logs, and system metadata:
    /opt/netuitive-agent/bin/get-support
    Note   If the command was input properly, the agent will output the following:
    Collecting logs and configuration....
    
    creating zip file....
    
    Please open a support case with and upload /opt/netuitive-agent/support-YYYYMMDD_173454.zip
    with a detailed description of the issue.
    
    Thank you
  2. Navigate to the zip file (now stored in /opt/netuitive-agent/).
  3. Open a support ticket by emailing support@netuitive.com with the zip file attached and a subject / message body describing the issue(s) you experienced.
Important   This command will only work with versions 0.4.0 and later of the agent.

Manually Installing the Linux Agent

For RPM-based systems:

  1. Copy the following into your command line:
  2. rpm --import https://repos.app.netuitive.com/RPM-GPG-KEY-netuitive
    rpm -ivh https://repos.app.netuitive.com/rpm/noarch/netuitive-repo-1-0.2.noarch.rpm
    yum -y install netuitive-agent

For DEB-based systems:

  1. Copy the following into your command line:
  2. curl -s https://repos.app.netuitive.com/netuitive.gpg | apt-key add -
    apt-get install -y apt-transport-https
    echo "deb https://repos.app.netuitive.com/deb/ stable main" > /etc/apt/sources.list.d/netuitive.list
    apt-get -y update
    apt-get install -y netuitive-agent

Manually Updating the Hostname

If you're having issues with the default naming method or the hostname isn't what you desire, you can manually set the hostname via the agent's configuration file (located at /opt/netuitive-agent/conf/netuitive-agent.conf). Consult the table below for more information.

Method Description Usage
Hard-coded

Force a hard-coded desired hostname.

  1. Uncomment the hostname setting.
    ..
    # hostname = my_custom_hostname
    ..
  2. Replace my_custom_hostname with your desired hostname, keeping in mind that periods are common separators.
smart

The agent will initially try to use the short FQDN (fully qualified domain name). If the short FQDN is "localhost", the agent will use the value returned by the hostname -s command.

Because smart is the default naming method, do not make changes to this section of the configuration file to continue using it.

fqdn (fully qualifed domain name)

Comprises three separate methods:

  • fqdn_short, which is similar to the value returned by the hostname -s command.
  • fqdn, which is the full hostname value.
  • fqdn_rev, which is the full hostname value but reversed, e.g., com.example.www.
  1. Uncomment the hostname_method setting.
    ..
    # hostname_method = smart
    ..
  2. Replace smart with the desired fqdn setting.
    										hostname_method = fqdn_rev
uname

Comprises two methods:

  • uname_short, which is similar to the value returned by the uname -n (network node hostname) command but only the first portion.
  • uname_rev, which is the value returned by the uname -r (kernel release) command but reversed, e.g., com.example.www.

  1. Uncomment the hostname_method setting.
    ..
    # hostname_method = smart
    ..
  2. Replace smart with the desired uname setting.
    											hostname_method = uname_short

hostname

Comprises three separate methods:

  • hostname_short, which is the value returned by the hostname -s command.
  • hostname, which is the full hostname value.
  • hostname_rev, which is the full hostname value but reversed, e.g., com.example.www.
  1. Uncomment the hostname_method setting.
    ..
    # hostname_method = smart
    ..
  2. Replace smart with the desired hostname setting.
    										hostname_method = hostname
shell

Uses the string set in the hard-coded hostname variable as a shell command. The agent will use its output (with spaces trimmed from both ends) as the hostname.

  1. Uncomment the hostname setting.
    ..
    # hostname = my_custom_hostname
    ..
  2. Replace my_custom_hostname with your desired shell command.
  3. Uncomment the hostname_method setting.
    ..
    # hostname_method = smart
    ..
  4. Replace smart with shell.
    hostname_method = shell

Upgrading the Linux Agent

  1. Stop the Linux Agent (use the appropriate command for your distro). The most common being:
    • service netuitive-agent stop
    • /etc/init.d/netuitive-agent stop
    • initctl stop netuitive-agent
    • systemctl stop netuitive-agent
  2. Run the update command for your distro:
    yum -y update netuitive-agent

    or

    apt-get update netuitive-agent

    or

    apt-get install --only-upgrade netuitive-agent
    Note   If you have not customized the Netuitive configuration file in any way (other than inputting the API key), jump to step 6. If you've customized the configuration file, continue on.
  3. Get the difference between the old configuration file (netuitive-agent.conf) and the new configuration file (netuitive-agent.conf.rpmnew):
    diff -u /opt/netuitive-agent/conf/netuitive-agent.conf.rpmnew /opt/netuitive-agent/conf/netuitive-agent.conf
  4. Copy your changes from the old file to new file.
  5. Rename the old file to netuitive-agent.conf.old and the new configuration file to netuitive-agent.conf.
  6. Start the Linux Agent. The most common commands being:
    • service netuitive-agent start
    • /etc/init.d/netuitive-agent start
    • initctl start netuitive-agent
    • systemctl start netuitive-agent
    Tip   You can delete the element in Netuitive, and it will reappear after the next processing cycle. Your element will not lose any data.

Removing the Linux Agent

  1. Stop the Linux Agent (use the appropriate command for your distro). The most common being:
    • service netuitive-agent stop
    • /etc/init.d/netuitive-agent stop
    • initctl stop netuitive-agent
    • systemctl stop netuitive-agent
  2. Remove the directory containing the Linux Agent (the default location is /opt/netuitive-agent).
    rm -r /opt/netuitive-agent
    Tip   If you don't want to be prompted for each file that needs to be deleted, use this instead:
    rm -rf /opt/netuitive-agent