Skip to content

Commit

Permalink
fix: added config section
Browse files Browse the repository at this point in the history
  • Loading branch information
josemore committed Oct 30, 2023
1 parent a4bc1d2 commit cd44da9
Show file tree
Hide file tree
Showing 2 changed files with 161 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,13 @@ To install the infrastructure agent on instances launched with AWS Elastic Beans

After a successful setup, it can take up to fifteen minutes before metrics begin to appear in New Relic. View your host's infrastructure pages at **[one.newrelic.com](https://one.newrelic.com/all-capabilities)**.

## Configure the infrastructure agent
To configure the infrastructure agent, either adapt the agent configuration file or use environment variables to determine the [agent settings](https://docs.newrelic.com/docs/infrastructure/install-infrastructure-agent/configuration/infrastructure-agent-configuration-settings/) based on our requirements.

Check warning on line 123 in src/content/docs/infrastructure/install-infrastructure-agent/config-management-tools/configure-infrastructure-agent-aws-elastic-beanstalk.mdx

View workflow job for this annotation

GitHub Actions / vale-linter

[vale] reported by reviewdog 🐶 [new-relic.ComplexWords] Consider using 'decide' or 'find' instead of 'determine'. Raw Output: {"message": "[new-relic.ComplexWords] Consider using 'decide' or 'find' instead of 'determine'.", "location": {"path": "src/content/docs/infrastructure/install-infrastructure-agent/config-management-tools/configure-infrastructure-agent-aws-elastic-beanstalk.mdx", "range": {"start": {"line": 123, "column": 114}}}, "severity": "INFO"}
Settings can be applied using any of the methods listed below:

Check warning on line 124 in src/content/docs/infrastructure/install-infrastructure-agent/config-management-tools/configure-infrastructure-agent-aws-elastic-beanstalk.mdx

View workflow job for this annotation

GitHub Actions / vale-linter

[vale] reported by reviewdog 🐶 [Microsoft.Passive] 'be applied' looks like passive voice. Raw Output: {"message": "[Microsoft.Passive] 'be applied' looks like passive voice.", "location": {"path": "src/content/docs/infrastructure/install-infrastructure-agent/config-management-tools/configure-infrastructure-agent-aws-elastic-beanstalk.mdx", "range": {"start": {"line": 124, "column": 14}}}, "severity": "INFO"}

- Settings in file: Edit the `newrelic.config` file in the `.ebextensions` folder with additional agent settings. Settings should be included in the `newrelic-infra.yml` file content.

Check warning on line 126 in src/content/docs/infrastructure/install-infrastructure-agent/config-management-tools/configure-infrastructure-agent-aws-elastic-beanstalk.mdx

View workflow job for this annotation

GitHub Actions / vale-linter

[vale] reported by reviewdog 🐶 [new-relic.ComplexWords] Consider using 'more' or 'extra' instead of 'additional'. Raw Output: {"message": "[new-relic.ComplexWords] Consider using 'more' or 'extra' instead of 'additional'.", "location": {"path": "src/content/docs/infrastructure/install-infrastructure-agent/config-management-tools/configure-infrastructure-agent-aws-elastic-beanstalk.mdx", "range": {"start": {"line": 126, "column": 88}}}, "severity": "INFO"}
- Settings in environment variables: Define the required `NRIA_*` environment variables via Elastic Beanstalk UI, API or CLI. It's also possible to define them via `option_settings` in the `newrelic.config` file. Learn more from [AWS Beanstalk documentation](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environments-cfg-softwaresettings.html).

## Uninstall the infrastructure agent

To uninstall the agent, update the `newrelic.config` from `.ebextensions` with the following configuration, then update the deployment.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
---
title: Network issues
type: troubleshooting
tags:
- Infrastructure
- Infrastructure monitoring troubleshooting
- Troubleshoot logs
- Network troubleshooting
metaDescription: Troubleshooting suggestions if the New Relic infrastructure agent is not able to connect to the New Relic endpoints
---

## Problem

The infrastructure agent is experiencing network issues connecting to New Relic endpoints.
Connectivity errors such as "Collector endpoint not reachable" or "Timeout exceeded while awaiting headers" appear on the agent logs.

## Solution

Verify that the New Relic infrastructure agent endpoints are reachable from the host where it is installed.

Check failure on line 19 in src/content/docs/infrastructure/new-relic-infrastructure/troubleshooting/network-connection-issues.mdx

View workflow job for this annotation

GitHub Actions / vale-linter

[vale] reported by reviewdog 🐶 [Microsoft.Contractions] Use 'it's' instead of 'it is'. Raw Output: {"message": "[Microsoft.Contractions] Use 'it's' instead of 'it is'.", "location": {"path": "src/content/docs/infrastructure/new-relic-infrastructure/troubleshooting/network-connection-issues.mdx", "range": {"start": {"line": 19, "column": 92}}}, "severity": "ERROR"}

Check warning on line 19 in src/content/docs/infrastructure/new-relic-infrastructure/troubleshooting/network-connection-issues.mdx

View workflow job for this annotation

GitHub Actions / vale-linter

[vale] reported by reviewdog 🐶 [Microsoft.Passive] 'is installed' looks like passive voice. Raw Output: {"message": "[Microsoft.Passive] 'is installed' looks like passive voice.", "location": {"path": "src/content/docs/infrastructure/new-relic-infrastructure/troubleshooting/network-connection-issues.mdx", "range": {"start": {"line": 19, "column": 95}}}, "severity": "INFO"}
Follow the instructions below to confirm there are no issues with your environment's network settings:

<CollapserGroup>

<Collapser id="windows" title="Windows">

Run the following command on the terminal:
```
$ Invoke-WebRequest -Uri "https://infra-api.newrelic.com/cdn-cgi/trace"
```

The expected output should include a `200 (OK)` as shown below:
```
StatusCode : 200
StatusDescription : OK
Content : fl=367f145
h=infra-api.newrelic.com
ip=XX.YY.ZZ.ZZ
ts=1696347189.607
visit_scheme=https
uag=Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.22621.963
colo=MAD
sliver=none
htt...
RawContent : HTTP/1.1 200 OK
Transfer-Encoding: chunked
Connection: keep-alive
Access-Control-Allow-Origin: *
CF-RAY: 81063def0905384e-MAD
X-Frame-Options: DENY
X-Content-Type-Options: nosniff
Cache-Control...
Forms : {}
Headers : {[Transfer-Encoding, chunked], [Connection, keep-alive], [Access-Control-Allow-Origin, *], [CF-RAY, 81063def0905384e-MAD]...}
Images : {}
InputFields : {}
Links : {}
ParsedHtml : System.__ComObject
RawContentLength : 284
```

</Collapser>

<Collapser id="linux" title="Linux">

1. **Resolve the domain:** Use nslookup or dig to validate that the Linux system can resolve the domain to an IP address:

Check warning on line 65 in src/content/docs/infrastructure/new-relic-infrastructure/troubleshooting/network-connection-issues.mdx

View workflow job for this annotation

GitHub Actions / vale-linter

[vale] reported by reviewdog 🐶 [new-relic.ComplexWords] Consider using 'discuss' instead of 'address'. Raw Output: {"message": "[new-relic.ComplexWords] Consider using 'discuss' instead of 'address'.", "location": {"path": "src/content/docs/infrastructure/new-relic-infrastructure/troubleshooting/network-connection-issues.mdx", "range": {"start": {"line": 65, "column": 114}}}, "severity": "INFO"}

```
$ nslookup infra-api.newrelic.com
```

The output should contain a name and IP address.

Check warning on line 71 in src/content/docs/infrastructure/new-relic-infrastructure/troubleshooting/network-connection-issues.mdx

View workflow job for this annotation

GitHub Actions / vale-linter

[vale] reported by reviewdog 🐶 [new-relic.ComplexWords] Consider using 'discuss' instead of 'address'. Raw Output: {"message": "[new-relic.ComplexWords] Consider using 'discuss' instead of 'address'.", "location": {"path": "src/content/docs/infrastructure/new-relic-infrastructure/troubleshooting/network-connection-issues.mdx", "range": {"start": {"line": 71, "column": 41}}}, "severity": "INFO"}

2. **Ping the server:** Try pinging the IP address obtained above to ensure you can reach the server.

Check warning on line 73 in src/content/docs/infrastructure/new-relic-infrastructure/troubleshooting/network-connection-issues.mdx

View workflow job for this annotation

GitHub Actions / vale-linter

[vale] reported by reviewdog 🐶 [new-relic.ComplexWords] Consider using 'discuss' instead of 'address'. Raw Output: {"message": "[new-relic.ComplexWords] Consider using 'discuss' instead of 'address'.", "location": {"path": "src/content/docs/infrastructure/new-relic-infrastructure/troubleshooting/network-connection-issues.mdx", "range": {"start": {"line": 73, "column": 44}}}, "severity": "INFO"}

```
$ ping 162.247.241.2
```

The server should be reachable.

3. **Traceroute:** Use traceroute to check the network path between your system and the server:

```
$ traceroute -I infra-api.newrelic.com
```

Analyze the output to identify potential network issues, such as high latency or packet loss.

4. **Curl:** Use curl to check if the endpoint is reachable:

```bash
$ curl -v https://infra-api.newrelic.com/cdn-cgi/trace

fl=366f101
h=infra-api.newrelic.com
ip=XX.YY.ZZ.ZZ
ts=1696347098.76
visit_scheme=https
uag=curl/7.88.1
colo=MAD
sliver=none
http=http/1.1
loc=ES
tls=TLSv1.3
sni=plaintext
warp=off
gateway=off
rbi=off
kex=X25519
* Connection #0 to host infra-api.newrelic.com left intact
```

</Collapser>

</CollapserGroup>

## Troubleshoot with NRDiag

[Code Implementation](https://github.com/newrelic/newrelic-diagnostics-cli/blob/main/tasks/infra/agent/connect.go#L48)

```bash
./nrdiag -t Infra/Agent/Connect
```

**Expected output:**

```
Check Results
-------------------------------------------------
Info Base/Env/CollectEnvVars [Gathered Environment variables of current shell.]
Success Base/Config/Collect
Success Base/Config/Validate
Success Base/Config/LicenseKey
Success Base/Config/ValidateLicenseKey
Success Infra/Config/Agent
Success Infra/Agent/Connect
3 results not shown: 3 None
See nrdiag-output.json for full results.
```

**Output when endpoints are not reachable:**

Check failure on line 141 in src/content/docs/infrastructure/new-relic-infrastructure/troubleshooting/network-connection-issues.mdx

View workflow job for this annotation

GitHub Actions / vale-linter

[vale] reported by reviewdog 🐶 [Microsoft.Contractions] Use 'aren't' instead of 'are not'. Raw Output: {"message": "[Microsoft.Contractions] Use 'aren't' instead of 'are not'.", "location": {"path": "src/content/docs/infrastructure/new-relic-infrastructure/troubleshooting/network-connection-issues.mdx", "range": {"start": {"line": 141, "column": 25}}}, "severity": "ERROR"}

```
Failure - Infra/Agent/Connect
There was an error connecting to https://log-api.newrelic.com
Please check network and proxy settings and try again or see -help for more options.
Error = Get "https://log-api.newrelic.com": dial tcp: lookup log-api.newrelic.com on [::1]:53: read udp [::1]:0->[::1]:53: i/o timeout
See https://docs.newrelic.com/docs/new-relic-solutions/get-started/networks/#infrastructure for more information.
```

Note that the nrdiag Connect task result is shown in stdout, it should be collected with the `nrdiag_output.zip` file.

Check warning on line 152 in src/content/docs/infrastructure/new-relic-infrastructure/troubleshooting/network-connection-issues.mdx

View workflow job for this annotation

GitHub Actions / vale-linter

[vale] reported by reviewdog 🐶 [Microsoft.Passive] 'is shown' looks like passive voice. Raw Output: {"message": "[Microsoft.Passive] 'is shown' looks like passive voice.", "location": {"path": "src/content/docs/infrastructure/new-relic-infrastructure/troubleshooting/network-connection-issues.mdx", "range": {"start": {"line": 152, "column": 42}}}, "severity": "INFO"}

Check warning on line 152 in src/content/docs/infrastructure/new-relic-infrastructure/troubleshooting/network-connection-issues.mdx

View workflow job for this annotation

GitHub Actions / vale-linter

[vale] reported by reviewdog 🐶 [Microsoft.Passive] 'be collected' looks like passive voice. Raw Output: {"message": "[Microsoft.Passive] 'be collected' looks like passive voice.", "location": {"path": "src/content/docs/infrastructure/new-relic-infrastructure/troubleshooting/network-connection-issues.mdx", "range": {"start": {"line": 152, "column": 72}}}, "severity": "INFO"}

Refer to the technical documentation in the [Github repo](https://github.com/newrelic/infrastructure-agent/blob/master/docs/network_troubleshooting.md) for additional details.

Check warning on line 154 in src/content/docs/infrastructure/new-relic-infrastructure/troubleshooting/network-connection-issues.mdx

View workflow job for this annotation

GitHub Actions / vale-linter

[vale] reported by reviewdog 🐶 [new-relic.ComplexWords] Consider using 'more' or 'extra' instead of 'additional'. Raw Output: {"message": "[new-relic.ComplexWords] Consider using 'more' or 'extra' instead of 'additional'.", "location": {"path": "src/content/docs/infrastructure/new-relic-infrastructure/troubleshooting/network-connection-issues.mdx", "range": {"start": {"line": 154, "column": 157}}}, "severity": "INFO"}

0 comments on commit cd44da9

Please sign in to comment.