Netdata Community

Problem to send Netdata alarm

Hi guys, sorry for a kinda newbie question.
I have netdata deployed and installed on one client machine, and have email notification enabled. In my environment, there is a postfix relay and it bypass all mail to outside mx.
I mailq the client and notice my netdata alarm is in deferred queue and cannot get out correctly. Mailq which shows error

09U9DWl9070492    10844 Fri Oct 30 09:13 <netdata@test.domain>
                 (Deferred: Connection timed out with mxa-00082601.gslb.pphost)
                                         <myself@test.domain>
09U9X0RC073560    10844 Fri Oct 30 09:33 <netdata@test.domain>
                 (Deferred: Connection timed out with mxb-00082601.gslb.pphost)
                                         <myself@test.domain>
09U9GWTQ071494    11452 Fri Oct 30 09:16 <netdata@test.domain>
                 (Deferred: Connection timed out with mxb-00082601.gslb.pphost)
                                         <myself@test.domain>

Here is what i did so far:

My health_alarm_notify.conf looks like this:

sendmail="/usr/sbin/sendmail"
EMAIL_SENDER="netdata@test.domain"
# enable/disable sending emails
SEND_EMAIL="YES"
# if a role recipient is not configured, an email will be send to:
DEFAULT_RECIPIENT_EMAIL="myself@test.domain"

my config on /etc/mail.rc mailx config

set from=netdata@test.domain
set smtp=postfix-1.test.domain
  1. Under user “netdata” with following command, and that msg could reach my inbox.
echo "test" | mail -s 'mail test' myself@test.domain
  1. Tried following command from netdata instruction,
su -s /bin/bash netdata  
bash -x /opt/netdata/usr/libexec/netdata/plugins.d/alarm-notify.sh test

it looks good also, this is the output

# SENDING TEST WARNING ALARM TO ROLE: sysadmin
2020-10-30 10:20:13: alarm-notify.sh: INFO: sent email notification for: client-1.test.domain test.chart.test_alarm is WARNING to 'myself@test.domain'
# OK

# SENDING TEST CRITICAL ALARM TO ROLE: sysadmin
2020-10-30 10:20:13: alarm-notify.sh: INFO: sent email notification for: client-1.test.domain test.chart.test_alarm is CRITICAL to 'myself@test.domain'
# OK

# SENDING TEST CLEAR ALARM TO ROLE: sysadmin
2020-10-30 10:20:13: alarm-notify.sh: INFO: sent email notification for: client-1.test.domain test.chart.test_alarm is CLEAR to 'myself@test.domain'
# OK

Could anyone point me out what i might missed or did wrong? Thanks so much indeed as i struggled in this for days…

Hello @walthack ,

Is the file /etc/mail.rc readable for any user?

Let me explain a little bit the environment used to send alarms, Netdata creates and overwrites some variables during startup. It is possible that if you set inside its $HOME an analogous file with the same information you have at /etc/mailr.rc, it will be able to send the emails. I am believing that netdata user does not have read permission on /etc/mail.rc.

Best regards!