Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable 'php_apc' crashed newrelic_plugin_agent #551

Open
g3rhard opened this issue Apr 27, 2018 · 1 comment
Open

Enable 'php_apc' crashed newrelic_plugin_agent #551

g3rhard opened this issue Apr 27, 2018 · 1 comment

Comments

@g3rhard
Copy link

g3rhard commented Apr 27, 2018

Hello there

When I enable php_apc monitoring:

  php_apc:
    name: hostname
    scheme: http
    host: localhost
    verify_ssl_cert: false
    port: 80
    path: /apc-nrp.php

I got this:

------------------------------------------------------------------------ [START]
/usr/local/bin/newrelic-plugin-agent Exception [2018-04-27T07:10:14.511446]
------------------------------------------------------------------------- [INFO]
Interpreter: /usr/bin/python
CLI arguments: /usr/local/bin/newrelic-plugin-agent -c /etc/newrelic/newrelic_plugin_agent.cfg
Exception: 'NoneType' object has no attribute 'get'
Traceback:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/helper/unix.py", line 92, in start
    self.controller.start()
  File "/usr/local/lib/python2.7/dist-packages/helper/controller.py", line 266, in start
    self.run()
  File "/usr/local/lib/python2.7/dist-packages/helper/controller.py", line 253, in run
    self.process()
  File "/usr/local/lib/python2.7/dist-packages/newrelic_plugin_agent/agent.py", line 118, in process
    self.start_plugin_polling()
  File "/usr/local/lib/python2.7/dist-packages/newrelic_plugin_agent/agent.py", line 280, in start_plugin_polling
    self.config.application.get(plugin))
  File "/usr/local/lib/python2.7/dist-packages/newrelic_plugin_agent/agent.py", line 108, in poll_plugin
    thread.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/local/lib/python2.7/dist-packages/newrelic_plugin_agent/agent.py", line 308, in thread_process
    obj.poll()
  File "/usr/local/lib/python2.7/dist-packages/newrelic_plugin_agent/plugins/base.py", line 460, in poll
    self.add_datapoints(data)
  File "/usr/local/lib/python2.7/dist-packages/newrelic_plugin_agent/plugins/php_apc.py", line 36, in add_datapoints
    system_stats.get('nslots',
AttributeError: 'NoneType' object has no attribute 'get'
-------------------------------------------------------------------------- [END]

Without this module everything is fine.
apc-nrp.php working:

curl localhost/apc-nrp.php
{"system_stats":null,"user_stats":{"num_slots":2053,"ttl":7200,"num_hits":63,"num_misses":9,"num_inserts":9,"num_entries":9,"expunges":0,"start_time":1524761237,"mem_size":76848,"memory_type":"mmap"},"shared_memory":{"num_seg":1,"seg_size":134217592,"avail_mem":134123560}}

System info:
newrelic-plugin-agent (1.3.0)
Python 2.7.13

Here is my config:
https://pastebin.com/aAyK0nGv

@g3rhard
Copy link
Author

g3rhard commented May 22, 2018

I think my problem have been solved, when author accept pull request: https://github.com/MeetMe/newrelic-plugin-agent/pull/504/files.
Because I using PHP 7 with php-apcu module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant