• EnglishEspañol日本語한국어Português
  • 로그인지금 시작하기

사용자의 편의를 위해 제공되는 기계 번역입니다.

In the event of any inconsistency between the English version and the translated version, the English versionwill take priority. Please visit this page for more information.

문제 신고

센드메일 통합

당사의 Sendmail 통합은 Sendmail 메일 전송 에이전트의 성능을 모니터링하여 에이전트를 신속하게 계측하고 모니터링할 수 있도록 도와줍니다.

New Relic과의 통합을 설정한 후 즉시 사용 가능한 것과 같은 대시보드에서 데이터를 확인하십시오.

통합을 설치하려면 다음 단계를 완료하세요.

인프라 에이전트 설치

Sendmail 통합을 사용하려면 먼저 동일한 호스트에 인프라 에이전트를 설치 해야 합니다. 클라이언트 에이전트는 호스트 자체를 모니터링하는 반면, 다음 단계에서 설치하게 될 통합은 Sendmail 관련 데이터로 모니터링을 확장합니다.

NRI-Flex를 사용하여 메트릭 캡처

Flex를 사용하면 Apache Zookeeper 지표를 캡처할 수 있습니다. 이전 단계에서 설치한 뉴렐릭 인프라 에이전트와 함께 번들로 제공됩니다.

  1. /newrelic-infra/integrations.d 경로에 sendmail-flex-config.yml 이라는 파일을 생성합니다.

  2. 다음 설정 예시로 sendmail-flex-config.yml 업데이트합니다.

    FAILED_MESSAGES_FILE_NAME 참조를 파일 이름으로 바꾸십시오. 이 파일 이름을 찾으려면 /var/mail/ 으로 이동하여 실패한 메시지에 대해 생성된 파일을 확인하세요.

    ---
    integrations:
    - name: nri-flex
    config:
    name: sendmailFlex
    apis:
    #check if Sendmail service is up.
    - event_type: SendmailUp
    commands:
    - run: echo "value:$(systemctl status sendmail | grep 'Active':' active (running)' | wc -l)"
    split_by: ':'
    #check if Sendmail service is down.
    - event_type: SendmailDown
    commands:
    - run: echo "value:$(systemctl status sendmail | grep 'Active':' inactive (dead)' | wc -l)"
    split_by: ':'
    #Read the number of times SMTP service is unreachable.
    - event_type: SendmailSMTPserviceUnreachable
    commands:
    - run: echo "value:$(cat /var/log/mail.log | grep -E 'stat=Service unavailable' | wc -l)"
    split_by: ':'
    #Read the count of error message - host not found.
    - event_type: SendmailHostNotFound
    commands:
    - run: echo "value:$(cat /var/log/mail.log | grep -c 'host not found')"
    split_by: ':'
    #Read the count of error logged.
    - event_type: SendmailErrorCount
    commands:
    - run: echo "value:$(cat /var/log/mail.err | wc -l)"
    split_by: ':'
    #Read the number of messages accepted for delivery.
    - event_type: SendmailMessageAcceptedForDelivery
    commands:
    - run: echo "value:$(cat /var/log/mail.log | grep -c 'Message accepted for delivery')"
    split_by: ':'
    #Read the number of messages sent & deferred.
    - event_type: SendmailMessageStatus
    commands:
    - run: echo "sent:$(cat /var/log/mail.log | grep 'stat=Sent' | wc -l)"
    split_by: ':'
    - run: echo "deferred:$(cat /var/log/mail.log | grep 'stat=Deferred' | wc -l)"
    split_by: ':'
    #Read the number of messages held by user.
    #Go to the path "/var/mail/" and check the file that has been created for failed messages and accordingly update "FAILED_MESSAGES_FILE_NAME" in the below command.
    - event_type: SendmailHeldMessage
    commands:
    - run: echo "value:$(cat /var/mail/FAILED_MESSAGES_FILE_NAME | grep -c 'Subject:')"
    split_by: ':'
    #Read the number of connection timeout.
    - event_type: SendmailConnectionTimeOut
    commands:
    - run: echo "value:$(cat /var/log/mail.log | grep -c 'timeout')"
    split_by: ':'
    #Read the recipients with message count.
    - event_type: SendmailRecipientsbyMessageCount
    commands:
    - run: cat /var/log/mail.log | grep "to=<.*.>" | awk '{n=split($7,a,"to="); print a[1],a[2]}' | cut -d "<" -f2 |cut -d ">" -f1 | sort | uniq -c | sort -nr
    split: horizontal
    header_split_by: \s+(\d+)\s+(.*.)
    set_header: [msgCount.total, recipients.total]
    regex_match: true
    split_by: \s+(\d+)\s+(.*.)
    - run: cat /var/log/mail.log | grep "to=<.*.>" | grep "$(date +'%b %e')" | awk '{n=split($7,a,"to="); print a[1],a[2]}' | cut -d "<" -f2 |cut -d ">" -f1 | sort | uniq -c | sort -nr
    split: horizontal
    header_split_by: \s+(\d+)\s+(.*.)
    set_header: [msgCount.latest, recipients.latest]
    regex_match: true
    split_by: \s+(\d+)\s+(.*.)
    #Read the recipients host/domain.
    - event_type: SendmailRecipientsHostname
    commands:
    - run: cat /var/log/mail.log | grep "to=<.*.>" | awk '{print $7}' | grep -oE '[^@]+[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,}' | sort | uniq -c
    split: horizontal
    header_split_by: \s+(\d+)\s+(.*.)
    set_header: [hostCount.total, hostname.total]
    regex_match: true
    split_by: \s+(\d+)\s+(.*.)
    - run: cat /var/log/mail.log | grep "to=<.*.>" | grep "$(date +'%b %e')" | awk '{print $7}' | grep -oE '[^@]+[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,}' | sort | uniq -c
    split: horizontal
    header_split_by: \s+(\d+)\s+(.*.)
    set_header: [hostCount.latest, hostname.latest]
    regex_match: true
    split_by: \s+(\d+)\s+(.*.)
    #Read the senders with message count.
    - event_type: SendmailSendersbyMessageCount
    commands:
    - run: cat /var/log/mail.log | grep "from=<.*@.*>" | awk '{print $7}' | cut -d "<" -f2 |cut -d ">" -f1 | sort | uniq -c
    split: horizontal
    header_split_by: \s+(\d+)\s+(.*.)
    set_header: [msg.total, senders.total]
    regex_match: true
    split_by: \s+(\d+)\s+(.*.)
    - run: cat /var/log/mail.log | grep "from=<.*@.*>" | grep "$(date +'%b %e')" | awk '{print $7}' | cut -d "<" -f2 |cut -d ">" -f1 | sort | uniq -c
    split: horizontal
    header_split_by: \s+(\d+)\s+(.*.)
    set_header: [msg.latest, senders.latest]
    regex_match: true
    split_by: \s+(\d+)\s+(.*.)
    #Read the senders host/domain.
    - event_type: SendmailSendersHostname
    commands:
    - run: cat /var/log/mail.log | grep "from=<.*.>" | awk '{print $7}' | grep -oE '[^@]+[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,}' | sort | uniq -c
    split: horizontal
    header_split_by: \s+(\d+)\s+(.*.)
    set_header: [hostCount.total, hostname.total]
    regex_match: true
    split_by: \s+(\d+)\s+(.*.)
    - run: cat /var/log/mail.log | grep "from=<.*.>" | grep "$(date +'%b %e')" | awk '{print $7}' | grep -oE '[^@]+[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,}' | sort | uniq -c
    split: horizontal
    header_split_by: \s+(\d+)\s+(.*.)
    set_header: [hostCount.latest, hostname.latest]
    regex_match: true
    split_by: \s+(\d+)\s+(.*.)

Sendmail 로그를 New Relic으로 전달

우리의 로그 포워딩 기능을 사용하여 Sendmail 로그를 뉴렐릭으로 전달할 수 있습니다.

/etc/newrelic-infra/logging.d/logging.yml 에 다음 스크립트를 추가합니다.

logs:
- name: mail.log
file: /var/log/mail.log
attributes:
logtype: sendmail_log
- name: mail.err
file: /var/log/mail.err
attributes:
logtype: sendmail_error

New Relic 인프라 에이전트 다시 시작

데이터 읽기를 시작하기 전에 인프라 에이전트 문서 의 지침을 사용하여 인프라 에이전트를 다시 시작하십시오.

bash
$
sudo systemctl restart newrelic-infra.service

몇 분 안에 애플리케이션이 메트릭을 one.newrelic.com 으로 보냅니다.

데이터 찾기

Sendmail 이라는 사전 구축된 대시보드 템플릿을 선택하여 Sendmail 애플리케이션 메트릭을 모니터링할 수 있습니다. 사전 구축된 대시보드 템플릿을 사용하려면 다음 단계를 따르세요.

  1. one.newrelic.com 에서,

    + Add data

    페이지로 이동하세요.

  2. Dashboards

    을 클릭합니다.

  3. 검색창에 sendmail 를 입력합니다.

  4. Sendmail 대시보드가 나타납니다. 그것을 클릭하여 설치하십시오.

    Sendmail 대시보드는 맞춤형 대시보드로 간주되며 Dashboards UI 에서 찾을 수 있습니다. 대시보드 사용 및 편집에 대한 문서는 대시보드 문서 를 참조하세요.

    다음은 최신 메시지의 전송 상태를 찾기 위한 NRQL 쿼리입니다.

    SELECT latest(sent) as 'Sent', latest(deferred) as ‘Deferred’
    FROM SendmailMessageStatus

    다음은 Sendmail 서비스 상태를 보기 위한 NRQL 쿼리입니다.

    SELECT latest(value) as 'Service Up'
    FROM SendmailUp
    TIMESERIES AUTO

다음은 뭐지?

NRQL 쿼리 작성 및 대시보드 생성에 대해 자세히 알아보려면 다음 문서를 확인하세요.

  • 기본 및 고급 쿼리를 생성 하기 위한 쿼리 빌더 소개

  • 대시보드를 사용자 지정하고 다양한 작업을 수행하기 위한 대시보드 소개

  • 대시보드를 관리하여

    디스플레이 모드를 조정하거나 대시보드에 더 많은 콘텐츠를 추가하세요.

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.