If you experience issues when installing or running the Python agent on a new host, test that the package is installed correctly and that it can contact our data collector service. If the data collector service is unreachable, it may be due to a blocked firewall. Perform these network connectivity tests to narrow down the cause of the problem.
The Python agent includes a built-in test app that can verify your connection to our collector. To verify with the test app, run this command with the path to your New Relic config file:
newrelic-admin validate-config LOCATION_OF_NEWRELIC.INI
This runs a test using the Python agent. The agent will report the sample data to the account that corresponds to the agent config file, and a test app named
Python Agent Test for the reported sample data will appear in the APM UI.
After the test is completed, the UI will show the app as inactive. Follow standard procedures to delete the test app from the APM index.
If no data is transferred to the UI after five minutes, check the messages output from the test as well as the log file produced. If you encounter any problem that suggests an issue with being able to reach our data collector service, then try these troubleshooting procedures:
Here are examples of error messages you may find.
To verify the network connection, run the following:
newrelic-admin network-config newrelic.ini
Look for results similar to this:
host = 'collector.newrelic.com'port = 0proxy_host = Noneproxy_port = Noneproxy_user = Noneproxy_pass = Nonessl = True
- Port: A value of
0for the port setting indicates that the appropriate port, such as 80 or 443, will be used depending on whether or not SSL is enabled.
- Proxy: If you have configured the agent to use a proxy, make sure the proxy settings reflect this. If no proxy settings are specified but any HTTP connections to the wider Internet are necessary, then make sure the appropriate proxy settings appear in the agent configuration file.
If the data collector appears unreachable:
- Check that the hostname for the primary data collector host can be resolved with UNIX system tools such as dig or nslookup.
- If this does not succeed, check the configuration of any domain name resolver files for your host.
Here is an example:
$ dig collector.newrelic.com; <<>> DiG 9.8.3-P1 <<>> collector.newrelic.com;; global options: +cmd;; Got answer:;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 62183;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 4;; QUESTION SECTION:;collector.newrelic.com. IN A;; ANSWER SECTION:collector.newrelic.com. 2453 IN A 18.104.22.168;; AUTHORITY SECTION:newrelic.com. 1163 IN NS ns2.p21.dynect.net.newrelic.com. 1163 IN NS ns1.p21.dynect.net.newrelic.com. 1163 IN NS ns4.p21.dynect.net.newrelic.com. 1163 IN NS ns3.p21.dynect.net.;; ADDITIONAL SECTION:ns1.p21.dynect.net. 3198 IN A 22.214.171.124ns2.p21.dynect.net. 8576 IN A 126.96.36.199ns3.p21.dynect.net. 7364 IN A 188.8.131.52ns4.p21.dynect.net. 8576 IN A 184.108.40.206;; Query time: 22 msec;; SERVER: 192.168.178.1#53(192.168.178.1);; WHEN: Tue Jun 11 18:58:23 2013;; MSG SIZE rcvd: 206
Our agents require your firewall to allow an outgoing connection to our network:
- TCP port 443 if using HTTPS over a SSL connection
- TCP port 80 if using a plain HTTP connection
If the hostname for the data collector host can be resolved, use UNIX system tools such as ping and traceroute to determine if network traffic can be routed to it. The network traffic path will vary. As long as the path reaches the final intended host, the length of the path and its hosts are not important.
If you cannot contact the data collector host, configure the agent to use any firewall HTTP proxy, or open the required outgoing ports in the firewall to allow connections to the data collector.