• /
  • EnglishEspañolFrançais日本語한국어Português
  • Inicia sesiónComenzar ahora

Te ofrecemos esta traducción automática para facilitar la lectura.

En caso de que haya discrepancias entre la versión en inglés y la versión traducida, se entiende que prevalece la versión en inglés. Visita esta página para obtener más información.

Crea una propuesta

Integración de envío de correo

Nuestra integración Sendmail monitorea el rendimiento de su agente de transferencia de correo Sendmail, ayudándolo a instrumentar y monitor rápidamente su agente.

Docs site

Después de configurar la integración con New Relic, vea sus datos en un dashboard como este, listo para usar.

Complete los siguientes pasos para instalar la integración:

Instalar el agente de infraestructura

Para emplear la integración de Sendmail, primero debe instalar el agente de infraestructura en el mismo host. El agente de infraestructura monitorea el host en sí, mientras que la integración que instalará en el siguiente paso extiende su monitoreo con datos específicos de Sendmail.

Utilice NRI-Flex para capturar métricas

Flex le permite capturar la métrica de Apache Zookeeper . Viene incluido con el agente de infraestructura New Relic que instalaste en el paso anterior.

  1. Cree un archivo llamado sendmail-flex-config.yml en la ruta /newrelic-infra/integrations.d .

  2. Actualice sendmail-flex-config.yml con el siguiente ejemplo de configuración.

    Cerciorar de reemplazar las referencias FAILED_MESSAGES_FILE_NAME con el nombre de su archivo. Para encontrar este nombre de archivo, vaya a /var/mail/ y verifique el archivo que se creó en busca de mensajes fallidos.

    ---
    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+(.*.)

Reenvía tu registro de Sendmail a New Relic

Puede emplear nuestra capacidad de reenvío de logs para reenviar logs de Sendmail a New Relic.

Agrega el siguiente script a /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

Reinicie el agente New Relic Infrastructure

Antes de que pueda comenzar a leer sus datos, utilice las instrucciones de nuestros documentos del agente de infraestructura para reiniciar su agente de infraestructura.

bash
$
sudo systemctl restart newrelic-infra.service

En un par de minutos, tu aplicación se enviará métrica a one.newrelic.com.

Encuentra tus datos

Puede elegir nuestra plantilla dashboard prediseñadas llamada Sendmail para monitor su aplicación métrica Sendmail. Siga estos pasos para utilizar nuestra plantilla dashboard prediseñadas:

  1. Desde one.newrelic.com, vaya a la página + Integrations & Agents .

  2. Haga clic en Dashboards.

  3. En la barra de búsqueda, escriba sendmail.

  4. Debería aparecer el dashboard de Sendmail. Haga clic en él para instalarlo.

    Su dashboard de Sendmail se considera un dashboard personalizado y se puede encontrar en la UI Dashboards. Para obtener documentos sobre el uso y edición del dashboard, consulte nuestros documentos dashboard .

    Aquí hay una consulta NRQL para encontrar el estado de envío de su último mensaje:

    SELECT latest(sent) AS 'Sent', latest(deferred) AS 'Deferred'
    FROM SendmailMessageStatus

    Aquí hay una consulta NRQL para ver el estado del servicio Sendmail:

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

¿Que sigue?

Para obtener más información sobre cómo crear una consulta NRQL y generar un dashboard, consulte estos documentos:

  • Introducción al generador de consultas para crear consultas básicas y avanzadas.
  • Introducción al dashboard para personalizar tu dashboard y realizar diferentes acciones.
  • Administre su dashboard para ajustar su modo de visualización o para agregar más contenido a su dashboard.
Copyright © 2025 New Relic Inc.

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