Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Newrelic-daemon - dial tcp: lookup agent_listener: no such host

php7

#1

After a successful installation using the nrmaninstall.php script, phpinfo() indicates newrelic (8.4.0.231) is loaded into my php7.2.13 and with the correct license key.

However, there is no application and no data appearing.

The newrelic-daemon.log reveals this pattern:
2018/12/13 09:19:15.202193 (32402) Warning: app ‘PHP 7.2’ connect attempt returned Post https://agent_listener/invoke_raw_method?license_key=fb2f43267ff069d1351a71f487e91d3b7e24d46e&marshal_format=json&method=get_redirect_host&protocol_version=14: dial tcp: lookup agent_listener: no such host
2018/12/13 09:19:38.862519 (32402) Warning: app ‘null’ connect attempt returned Post https://agent_listener/invoke_raw_method?license_key=fb2f43267ff069d1351a71f487e91d3b7e24d46e&marshal_format=json&method=get_redirect_host&protocol_version=14: dial tcp: lookup agent_listener: no such host
2018/12/13 09:19:51.593329 (32402) Warning: app ‘PHP 7.2’ connect attempt returned Post https://agent_listener/invoke_raw_method?license_key=fb2f43267ff069d1351a71f487e91d3b7e24d46e&marshal_format=json&method=get_redirect_host&protocol_version=14: dial tcp: lookup agent_listener: no such host
2018/12/13 09:20:14.292293 (32402) Warning: app ‘null’ connect attempt returned Post https://agent_listener/invoke_raw_method?license_key=fb2f43267ff069d1351a71f487e91d3b7e24d46e&marshal_format=json&method=get_redirect_host&protocol_version=14: dial tcp: lookup agent_listener: no such host

And the php_agent.log:
2018-12-13 08:09:11.141 -0500 (1749 1749) info: New Relic 8.4.0.231 (“dill” - “c6bb64e5a788”) [daemon=’/tmp/.newrelic.sock’ php=‘7.2.13’ zts=no sapi=‘cli’ pid=1749 ppid=1748 uid=0 euid=0 gid=0 egid=0 backtrace=yes startup=agent os=‘Linux’ rel=‘4.14.59-5553.el6.art.x86_64’ mach=‘x86_64’ ver=’#1 SMP Tue Jul 31 13’ node=‘server.rockbrookcamp.com’]
2018-12-13 08:34:21.904 -0500 (7909 7909) info: New Relic 8.4.0.231 (“dill” - “c6bb64e5a788”) [daemon=’/tmp/.newrelic.sock’ php=‘7.2.13’ zts=no sapi=‘fpm-fcgi’ pid=7909 ppid=7908 uid=0 euid=0 gid=0 egid=0 backtrace=yes startup=agent os=‘Linux’ rel=‘4.14.59-5553.el6.art.x86_64’ mach=‘x86_64’ ver=’#1 SMP Tue Jul 31 13’ node=‘server.rockbrookcamp.com’]
2018-12-13 09:09:00.534 -0500 (16823 16823) info: New Relic 8.4.0.231 (“dill” - “c6bb64e5a788”) [daemon=’/tmp/.newrelic.sock’ php=‘7.2.13’ zts=no sapi=‘cli’ pid=16823 ppid=16822 uid=0 euid=0 gid=0 egid=0 backtrace=yes startup=agent os=‘Linux’ rel=‘4.14.59-5553.el6.art.x86_64’ mach=‘x86_64’ ver=’#1 SMP Tue Jul 31 13’ node=‘server.rockbrookcamp.com’]

Also note:
[root@server newrelic]# ps ax|grep newrelic-daemon
28882 pts/0 S+ 0:00 grep newrelic-daemon
32397 ? Ssl 0:02 /usr/bin/newrelic-daemon --agent --pidfile /var/run/newrelic-daemon.pid --logfile /var/log/newrelic/newrelic-daemon.log --port /tmp/.newrelic.sock --tls --define utilization.detect_aws=true --define utilization.detect_azure=true --define utilization.detect_gcp=true --define utilization.detect_pcf=true --define utilization.detect_docker=true
32402 ? Sl 0:35 /usr/bin/newrelic-daemon --agent --pidfile /var/run/newrelic-daemon.pid --logfile /var/log/newrelic/newrelic-daemon.log --port /tmp/.newrelic.sock --tls --define utilization.detect_aws=true --define utilization.detect_azure=true --define utilization.detect_gcp=true --define utilization.detect_pcf=true --define utilization.detect_docker=true -no-pidfile
[root@server newrelic]#

I also ran the NR diagnostics with this result:
[root@server php.d]# ./nrdiag

Check Results

Info Base/Env/CollectEnvVars [Gathered Environment variables of current shell.]
Success Base/Config/Collect
Success Base/Config/Validate
Success Base/Config/LicenseKey
Info Base/Config/RegionDetect [1 unique New Relic region(s) detected from config.]
Success Base/Log/Copy
Warning Java/AppServer/WebSphere
Info Base/Env/HostInfo [server.rockbrookcamp.com]
Success PHP/Config/Agent
Success Base/Collector/ConnectUS
Success PHP/Daemon/Running
Info PHP/Agent/Version [8.4.0.231]
44 results not shown: 44 None
See nrdiag-output.json for full results.

Issues Found

Warning
We suspect this is a WebSphere environment but we’re unable to determine the version. Supported status is unknown.
See https://docs.newrelic.com/docs/agents/java-agent/additional-installation/ibm-websphere-application-server for more information.

This server is running Centos 6.10 and Plesk 17.8.11

Thanks in advance for any advice, etc.


#2

This is not a WebSphere system, so I’m stuck.

The other thing complicating the install is Plesk, and its multiple versions of PHP.


#3

After a re-install the diagnostics is looking better, but there is still no data or recognition of the application.

[root@server php.d]# ./nrdiag

Check Results

Info Base/Env/CollectEnvVars [Gathered Environment variables of current shell.]
Success Base/Config/Collect
Success Base/Config/Validate
Success Infra/Config/Agent
Success Base/Log/Copy
Info Infra/Agent/Version [1.1.9]
Success Infra/Agent/Connect
Info Base/Env/HostInfo [server.rockbrookcamp.com]
Success PHP/Config/Agent
Success PHP/Daemon/Running
Success Base/Config/LicenseKey
Info Base/Config/RegionDetect [1 unique New Relic region(s) detected from config.]
Warning Infra/Log/LevelCheck
Info PHP/Agent/Version [8.4.0.231]
Success Base/Collector/ConnectUS
41 results not shown: 41 None
See nrdiag-output.json for full results.

Issues Found

Warning
Infrastructure logging level not set to verbose. If troubleshooting an Infrastructure issue, please set verbose: 1 in newrelic-infra.yml.
See https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/troubleshooting/generate-logs-troubleshooting-infrastructure for more information.

[root@server php.d]#


#4

Hey @jdrcarter

So if it’s loading in the PHPinfo page, then that’s a great start. So I would check the communication port newrelic.daemon.port and just check if it’s a /tmp/.newrelic.sock configuration, or a TCP port number or an abstract socket like @newrelic-daemon

It’s possible your agent can’t reach the daemon and has nothing to report then. If it’s failing you’ll likely see an error about connecting in the php_agent.log.

If the connection of agent to daemon is fine, then the issue may be data getting from your server to New Relic. Perhaps attempt some of these commands to see if they all can connect to New Relic from the command line of the server you’re working on.

ping collector.newrelic.com

traceroute collector.newrelic.com

curl -v http://collector.newrelic.com/status/mongrel

curl -v https://collector.newrelic.com/status/mongrel (please note these are two separate calls)


#5

Along with the the above curl commands, I notice that URL in the error message is invalid. That should be https:/collector.newrelic.com/agent_listener/invoke_raw_method?

The URL is controlled by this setting in your newrelic.ini:

; Setting: newrelic.daemon.collector_host
; Type   : string
; Scope  : system
; Default: collector.newrelic.com
; Info   : Sets the host name of the New Relic data collector host to use.
;          Please note that this is NOT any form of local host. It refers to
;          the New Relic provided host. There is very little reason to ever
;          change this from the default except in certain very special
;          circumstances, and then only on instruction from a New Relic sales
;          person or support staff member.
;
;newrelic.daemon.collector_host = "collector.newrelic.com"

As the description states, this shouldn’t be changed from the default. It is working confirming if this is showing up in your phpinfo() page correctly.


#6

Hello @acuffe and @beastman

We may be onto something, but I’m not sure how to proceed.
The ping, traceroute, and curl calls all seem fine.
On the other hand, the phpinfo() is perhaps showing some missing info:

newrelic Global Directives

Directive Name Global Value
newrelic.daemon.app_timeout no value
newrelic.daemon.auditlog no value
newrelic.daemon.collector_host no value
newrelic.daemon.dont_launch no value
newrelic.daemon.location /usr/bin/newrelic-daemon
newrelic.daemon.logfile /var/log/newrelic/newrelic-daemon.log
newrelic.daemon.loglevel no value
newrelic.daemon.pidfile no value
newrelic.daemon.port /tmp/.newrelic.sock
newrelic.daemon.proxy no value
newrelic.daemon.ssl enabled
newrelic.daemon.ssl_ca_bundle no value
newrelic.daemon.ssl_ca_path no value
newrelic.daemon.utilization.detect_aws enabled
newrelic.daemon.utilization.detect_azure enabled
newrelic.daemon.utilization.detect_docker enabled
newrelic.daemon.utilization.detect_gcp enabled
newrelic.daemon.utilization.detect_pcf enabled
newrelic.feature_flag no value
newrelic.high_security 0
newrelic.logfile /var/log/newrelic/php_agent.log
newrelic.loglevel info
newrelic.transaction_tracer.internal_functions_enabled disabled

Looking at my newrelic.ini, it seems like everything is default or commented out.

Thanks again for your suggestions.


#7

Also my newrelic.ini is set at 444. That seems restrictive. Should it be 644?


#8

The no value is expected because it is commented out by default and the setting is more of an override for the default than a required value.

I’m not seeing any reason for it to be removing the collector.newrelic.com from the URL but you can try forcing it by enabling the setting like this:

newrelic.daemon.collector_host = “collector.newrelic.com

Then kill all newrelic-daemon processes and restart your PHP processes to apply the new setting to newrelic-daemon.


#9

That was it!

A quick edit to my newrelic.ini, specifying the correct “collector” and we are completely back… all features reporting.

Good eye spotting that bad url in the logs! “No such host” turns out to be a URL problem! :grinning:

Thanks for the insights and advice.