Skip to content

Exim integration gives no metric data #2209

Open

Description

Output of the info page

    ------------
      Instance ID: exim:c933403ba680af29 [OK]
      Configuration Source: file:/etc/datadog-agent/conf.d/exim.d/conf.yaml
      Total Runs: 2,942
      Metric Samples: Last Run: 0, Total: 0
      Events: Last Run: 0, Total: 0
      Service Checks: Last Run: 1, Total: 2,942
      Average Execution Time : 1ms
      Last Execution Date : 2023-11-30 13:13:41 CET / 2023-11-30 12:13:41 UTC (1701346421000)
      Last Successful Execution Date : 2023-11-30 13:13:41 CET / 2023-11-30 12:13:41 UTC (1701346421000)

Additional environment details (Operating System, Cloud provider, etc):
Ubuntu 22.04.1 on Google Cloud Platform

Describe the results you received:
No metrics received even when queue has messages.
Results of running exim -bp | exiqsumm is

Count  Volume  Oldest  Newest  Domain
-----  ------  ------  ------  ------

  680  1312KB     69h     19h  foobar.xyz
---------------------------------------------------------------
  680  1312KB     69h     19h  TOTAL

Log files in /var/log/datadog/agent.log with log level set as debug shows these results

2023-11-30 12:38:41 CET | CORE | DEBUG | (pkg/collector/python/check.go:88 in runCheck) | Running python check exim (version: '1.0.0', id: 'exim:c933403ba680af29')
2023-11-30 12:38:41 CET | CORE | DEBUG | (pkg/collector/python/datadog_agent.go:135 in LogMessage) | exim:c933403ba680af29 | (subprocess_output.py:55) | Running get_subprocess_output with cmd: ['exim -bp', '|', 'exiqsumm']
2023-11-30 12:38:41 CET | CORE | DEBUG | (pkg/collector/python/datadog_agent.go:135 in LogMessage) | exim:c933403ba680af29 | (subprocess_output.py:59) | get_subprocess_output returned (len(out): 0 ; len(err): 0 ; returncode: 0)

Describe the results you expected:
Expected results with a Count of 680 as shown in command line execution above and a value of 1312000 for volume.

Additional information you deem important (e.g. issue happens only occasionally):

Some debugging was done on the code and as far as I see, it is an bug in the code. The metric is created by a command called here. exim/datadog_checks/exim/check.py

  • The command is input wrong in the function call, it should be given as command and options separately, i.e ['exim', '-bp'] vs ['exim -bp'] . Datadog documentation also confirms this here. writing-checks-that-run-command-line-programs

  • The function call uses two commands piped together, while the documentation for the get_process_output clearly outlines that a piped command won't work here base/utils/subprocess_output.py

  • There are no tests run to check if the exim -bp command works here test_exim.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions