jwestbrook / datadog-asteriskpbx

DataDog Agent plugin for the Open Source Asterisk PBX

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error loading checks

danjenkins opened this issue · comments

On ubuntu I followed the instructions and even changed the permissions on the readme and I still get

  Loading Errors
  ==============
    asteriskpbx
    -----------
      Core Check Loader:
        Check asteriskpbx not found in Catalog

      JMX Check Loader:
        check is not a jmx check, or unable to determine if it's so

      Python Check Loader:
        unable to import module 'asteriskpbx': Traceback (most recent call last):
  File "/etc/datadog-agent/checks.d/asteriskpbx.py", line 11, in <module>
    from checks import AgentCheck
ImportError: No module named checks

Need to amend the import to

try:
    # first, try to import the base class from old versions of the Agent...
    from checks import AgentCheck
except ImportError:
    # ...if the above failed, the check is running in Agent version 6 or later
    from datadog_checks.checks import AgentCheck

Still having other issues with the module so will track those down too and then do a PR

On any version of asterisk 14 and above this won't work without a new version pf pyst2 - jfernandz/pyst2#47

On 14 onwards the sip peers check needs to check for the number on -2 from the end rather than -3 (same for iax and dahdi i'd assume etc)

if you don't have particular modules loaded like iax2 then it shouldn't error out

There is a lot of work that I've to do to make this compatible with newer versions of Asterisk. As soon I have updates I'll be posting them. Also I want to make this integration available at the core installation of datadog. Thanks for all the comments and observations @danjenkins !

@danjenkins this week I'm working on the fix on supporting new Asterisk Versions and an update of the pyst2 dependency.