init_config:## @param postfix_user - string - required## The user running dd-agent must have passwordless sudo access for the find## command to run the postfix check. Here's an example:## example /etc/sudoers entry:## dd-agent ALL=(postfix) NOPASSWD:/usr/bin/find /var/spool/postfix/incoming -type f#### Redhat/CentOS/Amazon Linux flavours need to add:## Defaults:dd-agent !requiretty#postfix_user:postfixinstances:## @param directory - string - optional - default: /var/spool/postfix## Path to the postfix directory. The directory option is required if `postqueue: false` is set. For more ## information see https://docs.datadoghq.com/integrations/postfix/#using-sudo.#- directory:/var/spool/postfix## @param queues - list of string - required## List of queues to monitor.#queues:- incoming- active- deferred
queues에 있는 각 메일 대기열에 대해 에이전트가 디렉터리에서 find를 분기합니다. 이를 위해 Postfix 사용자의 권한으로 sudo를 사용하기 때문에 에이전트 사용자 dd-agent에 다음 /etc/sudoers 줄을 추가해야 합니다. 이 경우 Postfix가 postfix로 실행된다고 추정합니다.
dd-agent ALL=(postfix) NOPASSWD:/usr/bin/find /var/spool/postfix/incoming -type f
dd-agent ALL=(postfix) NOPASSWD:/usr/bin/find /var/spool/postfix/active -type f
dd-agent ALL=(postfix) NOPASSWD:/usr/bin/find /var/spool/postfix/deferred -type f
에이전트 설정 디렉터리의 루트에 있는 conf.d/ 폴더에서 postfix.d/conf.yaml 파일을 편집합니다.
init_config:## @param postqueue - boolean - optional - default: false## Set `postqueue: true` to gather mail queue counts using `postqueue -p`## without the use of sudo. Postqueue binary is ran with set-group ID privileges,## so that it can connect to Postfix daemon processes.## Only `tags` keys are used from `instances` definition.## Postfix has internal access controls that limit activities on the mail queue.## By default, Postfix allows `anyone` to view the queue. On production systems## where the Postfix installation may be configured with stricter access controls,## you may need to grant the dd-agent user access to view the mail queue.#### postconf -e "authorized_mailq_users = dd-agent"#### http://www.postfix.org/postqueue.1.html#### authorized_mailq_users (static:anyone)## List of users who are authorized to view the queue.#postqueue:trueinstances:## @param config_directory - string - optional## The config_directory option only applies when `postqueue: true`.## The config_directory is the location of the Postfix configuration directory## where main.cf lives.#- config_directory:/etc/postfix## @param queues - list of string - required## List of queues to monitor.#queues:- incoming- active- deferred
instances에 있는 각 config_directory에 대해 에이전트는 Postfix 구성 디렉터리의 postqueue -c를 분기합니다. Postfix에는 메일 대기열의 활동을 제한할 수 있는 내부 액세스 컨트롤이 있습니다. 기본적으로 Postfix는 anyone(누구나) 대기열을 볼 수 있도록 합니다. Postfix 설치가 더 엄격한 액세스 컨트롤로 구성되어 있는 프로덕션 시스템의 경우, 메일 대기열을 보려면 dd-agent 사용자 액세스를 부여해야 할 수 있습니다. 상세한 내용은 postqueue Postfix 설명서를 참고하세요.
The number of messages in a given mail queue, tagged by queue name (e.g. ‘queue:incoming’) and directory (e.g. ‘instance:/var/spool/postfix/incoming’). Shown as email