To find out if this integration is available in your organization, see your Datadog Integrations page or ask your organization administrator.
To initiate an exception request to enable this integration for your organization, email support@ddog-gov.com.
이 페이지는 아직 한국어로 제공되지 않습니다. 번역 작업 중입니다.
현재 번역 프로젝트에 대한 질문이나 피드백이 있으신 경우
언제든지 연락주시기 바랍니다.Overview
This check monitors Exim through the Datadog Agent. It runs exim -bp once, summarizes the queue with exiqsumm, and reports the size, volume, age and number of frozen entries of the mail queue per recipient domain. It also reports whether the Exim systemd unit is running.
Setup
Follow the instructions below to install and configure this check for an Agent running on a host. For containerized environments, see the Autodiscovery Integration Templates for guidance on applying these instructions.
Installation
For Agent v7.21+ / v6.21+, follow the instructions below to install the exim check on your host. See Use Community Integrations to install with the Docker Agent or earlier versions of the Agent.
Run the following command to install the Agent integration:
datadog-agent integration install -t datadog-exim==<INTEGRATION_VERSION>
Configure your integration similar to core integrations.
Prerequisites
The check runs exim -bp and pipes its output through exiqsumm, so both utilities must be installed on the host. The check uses the absolute paths /usr/sbin/exim and /usr/sbin/exiqsumm by default because the PATH the check runs with does not always include /usr/sbin, for example when the check is run manually from a non-root shell. Set exim_path and exiqsumm_path if your installation uses other locations.
Queue listing permissions
Exim only allows admin users to list the queue while the queue_list_requires_admin option is enabled, which is the default. Exim treats root, the Exim user, members of the Exim group and members of the groups in admin_groups as admin users. On a default installation exim -bp therefore fails for the Agent user and the check reports exim.returns.output as CRITICAL with the error from Exim:
- Exim 4.96 and earlier:
exim: permission denied - Exim 4.97 and later:
exim: permission denied; not admin
Choose one of the following options:
Use sudo (recommended). Set use_sudo: true in the check configuration. The check then runs sudo -n /usr/sbin/exim -bp, which fails immediately instead of prompting for a password when sudo is not set up. Grant the Agent user passwordless sudo for exactly this command by adding the following line to /etc/sudoers (for example with visudo). Adjust the path if you changed exim_path:
dd-agent ALL=(root) NOPASSWD:/usr/sbin/exim -bp
On Red Hat based systems, also add:
Defaults:dd-agent !requiretty
This is the narrowest option: the rule only allows listing the queue.
Add the Agent user to the Exim group. For example usermod -aG Debian-exim dd-agent on Debian and Ubuntu, or usermod -aG exim dd-agent on Red Hat based systems, then restart the Agent. No sudo is needed, but Exim has no read-only admin role: the Agent user also gets every other admin privilege, such as removing, freezing or forcing delivery of queued messages.
Disable queue_list_requires_admin in the Exim configuration. This lets any local user list the queue, including sender and recipient addresses, so only do this when that is acceptable for your environment.
Configuration
Edit the exim.d/conf.yaml file, in the conf.d/ folder at the root of your Agent’s configuration directory to start collecting your exim performance data. See the sample exim.d/conf.yaml for all available configuration options.
init_config:
instances:
- use_sudo: true
## Uncomment if the binaries are not in /usr/sbin
# exim_path: /usr/sbin/exim
# exiqsumm_path: /usr/sbin/exiqsumm
Restart the Agent.
Validation
Run the Agent’s status subcommand and look for exim under the Checks section. A healthy run reports Metric Samples: Last Run: 2 or more and the exim.returns.output service check as OK.
exiqsumm always prints a TOTAL summary row, so the exim.queue.count and exim.queue.volume metrics with the tag domain:TOTAL are submitted on every successful run, with a value of 0 when the queue is empty. If these metrics are missing, the command did not run; check the service check message and the Agent log for the error reported by exim or sudo, such as sudo: a password is required when the sudoers rule is missing.
To verify the command outside the Agent, run it as the Agent user:
sudo -u dd-agent /bin/sh -c 'sudo -n /usr/sbin/exim -bp | /usr/sbin/exiqsumm'
Data Collected
Metrics
| |
|---|
exim.queue.count (gauge) | The number of messages in a given mail queue Shown as unit |
exim.queue.frozen.count (gauge) | Number of recipients of frozen messages in a given mail queue, counted per recipient domain like exim.queue.count Shown as unit |
exim.queue.volume (gauge) | The volume of messages in a given mail queue Shown as byte |
exim.queue.oldest_age (gauge) | Approximate age of the oldest message in a given mail queue, with a resolution of minutes, hours or days Shown as second |
Metrics are tagged with domain:<RECIPIENT_DOMAIN>. The domain:TOTAL series summarizes the whole queue. Like exiqsumm, the counts are per undelivered recipient, so a message to two domains is counted once for each domain.
exim.queue.count and exim.queue.volume: the number of queued recipients and their volume in bytes, converted from the KB and MB values that exiqsumm rounds to.exim.queue.oldest_age: the age in seconds of the oldest queued message. Exim reports ages in minutes up to 90 minutes, in rounded hours up to 72 hours and in rounded days beyond that, so the value has the same resolution.exim.queue.frozen.count: the number of queued recipients of frozen messages. Exim does not retry frozen messages until they are thawed or removed, so a value above 0 usually needs attention. For recipient domains longer than 78 characters the value can be too low, because exiqsumm truncates the domain column.
Events
The Exim integration does not include any events.
Service Checks
exim.returns.output
Returns CRITICAL if the Agent is unable to run the command to retrieve the exim queue state.
Statuses: ok, critical
exim.service.running
Returns OK if the Exim systemd unit is active, CRITICAL if it is in any other state, and UNKNOWN if no Exim unit is found or systemd is not available.
Statuses: ok, critical, unknown
exim.service.running reports the state of the Exim systemd unit, using systemctl show -p LoadState,ActiveState <unit>:
OK when the unit is active.CRITICAL when the unit exists but is in any other state, such as inactive or failed.UNKNOWN when no Exim unit is found or systemctl is not available, for example on hosts without systemd. Queue metrics are still collected.
When service_name is not set, the check tries the exim4 unit (Debian, Ubuntu) and then exim (Red Hat based systems).
The core systemd integration monitors any systemd unit, including Exim, with more detail. exim.service.running is a convenience for hosts where Exim is the only unit you want to monitor.
Troubleshooting
Need help? Contact Datadog support.