Skip to content

josemore/infrastructure-agent

 
 

Repository files navigation

Community Project header

New Relic infrastructure agent

The infrastructure agent (infra-agent) collects inventory data and metrics of your hosts and sends it to the New Relic platform.

New Relic provides flexible, dynamic monitoring of your entire infrastructure, from services running in the cloud or on dedicated hosts to containers running in orchestrated environments.

Compatibility and requirements

Go 1.11 or higher is required to build the infrastructure agent.

You can build the agent for any OS and architecture supported by Go; New Relic does not provide support for all of them. For more information on operating systems supported by New Relic, see the agent compatibility docs.

Set up your license key

Before using the agent, you need to add the New Relic license key to the newrelic-infra.yml configuration file. The default location is:

  • Linux: /etc/newrelic-infra.yml
  • Windows: C:\Program Files\New Relic\newrelic-infra\newrelic-infra.yml

For more information on configuration methods, precedence, and structure, see the Configure the Infrastructure agent document.

Compile and build the agent

This repository contains a number of scripts that facilitate building infra-agent for environments supported by New Relic: Linux, Windows, and Docker.

To build the agent for architectures and OSes different than the one where the build is running, set the Go environment variables to target the desired OS/Architecture combination. For example:

$ make dist-for-os GOOS=linux

To compile and build the agent run these commands:

  • Linux:

    $ make compile # On CentOS 5: make compile-centos-5
    $ make dist
  • Windows:

    PS C:\> ./win_build.ps1
  • Docker: see the instructions for building a Docker image.

To build the agent on CentOS 5 use Go 1.9

Run the agent

Once you've built the agent, you'll find the following binary files inside the target/bin/{OS_ARCH} directory:

  • newrelic-infra: Main process of the agent, tasked with gathering host data and running integrations.
  • newrelic-infra-service: Parent process that looks after the main process, making sure it executes and stays up.
  • newrelic-infra-ctl: Troubleshooting utility that enables verbose logs and executes health checks. For more information, see Troubleshooting a running agent.

The agent must run in root/administrator mode.

Use the agent

You can start, stop, restart, and check the Infrastructure agent from the command line.

For more information, see our official documentation.

Testing

To execute unit tests, run this command:

$ make test

You can run a specific test by invoking go (which is also how you can run tests on Windows):

$ go test -race -run ''      # Run all tests.
$ go test -race -run Foo     # Run top-level tests matching "Foo", such as "TestFooBar".
$ go test -race -run Foo/A=  # For top-level tests matching "Foo", run subtests matching "A=".
$ go test -race -run /A=1    # For all top-level tests, run subtests matching "A=1".

For more information, see Testing in the official Go docs.

Documentation

Find more documentation about the overall architecture, components, and workflows in the docs directory.

Support

New Relic provides support for its infrastructure agent when it's installed using the official packages. You can build the agent from the source and use it with New Relic without official support: To get support for features or systems you've added, we strongly encourage you to open a pull request.

For more information about reporting security issues, see our reporting security process

New Relic Explorers Hub

New Relic hosts and moderates an online forum where customers can interact with New Relic employees as well as other customers to get help and share best practices. Like all official New Relic open source projects, there's a related Community topic in the New Relic Explorers Hub. You can find this project's topic/threads here:

https://discuss.newrelic.com/c/support-products-agents/new-relic-infrastructure

Privacy

At New Relic we take your privacy and the security of your information seriously, and are committed to protecting your information. We must emphasize the importance of not sharing personal data in public forums, and ask all users to scrub logs and diagnostic information for sensitive information, whether personal, proprietary, or otherwise.

We define “Personal Data” as any information relating to an identified or identifiable individual, including, for example, your name, phone number, post code or zip code, Device ID, IP address, and email address.

Review New Relic’s General Data Privacy Notice for more information.

Contributing

We encourage your contributions to improve the infrastructure agent! Keep in mind when you submit your pull request, you'll need to sign the CLA via the click-through using CLA-Assistant. You only have to sign the CLA one time per project. If you have any questions, or to execute our corporate CLA, required if your contribution is on behalf of a company, drop us an email at opensource@newrelic.com.

A note about vulnerabilities

As noted in our security policy, New Relic is committed to the privacy and security of our customers and their data. We believe that providing coordinated disclosure by security researchers and engaging with the security community are important means to achieve our security goals.

If you believe you have found a security vulnerability in this project or any of New Relic's products or websites, we welcome and greatly appreciate you reporting it to New Relic through HackerOne.

To do

Provide full CI via GitHub Actions:

  • Integrations tests pipeline
    • Platform tests
    • Window tests & builds
    • Installation tests
    • Fuzz testing
  • Release pipeline

Code of Conduct

Read our Code of Conduct to understand how we operate in open source and what we expect of contributors.

License

Infrastructure Agent is licensed under the Apache 2.0 License.

Packages

No packages published

Languages

  • Go 97.2%
  • Shell 1.9%
  • Other 0.9%