pabloa / grafana-alerts

Grafana Alerts - Alerts generated using metrics from Grafana dashboards - This project is looking for a maintainer. Send me a message if you are interested.
Other
40 stars 14 forks source link

unable to receive alerts #6

Open bbenichou opened 9 years ago

bbenichou commented 9 years ago

Hi,

First thing first thanks for this great addition to grafana. A simple notification system is exactly what I was looking for.

Anyway I've followed step by step your installation guide but I'm not receiving any notifications. I'm using UBUNTU 14.04 LTS I've set a simple "x>=0" that should fire alerts all the time. I've checked my smtp connection using telnet: no problem. In syslog I can see grafana alerts being launched by the CRON. Here is my alerting conf in Grafana: grafanaalerts

In the syslog I get: Jul 3 11:21:01 ubu001-ProLiant-ML110-G5 CRON[19330]: (root) CMD (grafana_alerts) Jul 3 11:21:01 ubu001-ProLiant-ML110-G5 CRON[19329]: (CRON) info (No MTA installed, discarding output)

I've tried to install POSTFIX but grafana-alerts didn't override the sender and recipient and the mail sent was not the notification.

Is there any configuration or specific MTA to use?

Thanks, Ben

pabloa commented 9 years ago

Hello

It seems the mail was sent to a local email account called root@ubu001-ProLiant-ML110-G5 in the host where grafana alerts is running. I believe it is a configuration issue. If that is the case: check the values in /etc/grafana_alerts/grafana_alerts.cfg

Modify this properties:

# write a valid email address (for example, your company email address. You can modify it later) _emailfrom = alert@example.com

_# smtp server to use (default value: localhost). Now you are using localhost. # check how the email server is configured or ask for that information. I think# the problem is mails are not being re routed.smtpserver = localhost *# smtp server host to use (default value: 25)

if port is not 25, starts a tls session.

smtp_port* = 25

_# smtp server username to use IF it is needed. Optional. # Leave it commented if not used. (default value: no username) #_smtp_username\ = my_smtp_username

_# smtp server password to use IF it is needed. Optional. #Leave it commented if not used. (default value: no password) #_smtp_password\ = my_smtp_password

Mails should be sent to the right destination.

On Fri, Jul 3, 2015 at 2:09 AM, bbenichou notifications@github.com wrote:

I checked the syslog more carefully and actually right after Postfix has sent the notification I can see a "removed" trace.

Jul 3 10:09:01 ubu001-ProLiant-ML110-G5 CRON[16091]: (root) CMD (grafana_alerts) Jul 3 10:09:01 ubu001-ProLiant-ML110-G5 postfix/pickup[16066]: 6AC7A22009F: uid=0 from= Jul 3 10:09:01 ubu001-ProLiant-ML110-G5 postfix/cleanup[16094]: 6AC7A22009F: message-id= 20150703100901.6AC7A22009F@ubu001-ProLiant-ML110-G5 Jul 3 10:09:01 ubu001-ProLiant-ML110-G5 postfix/qmgr[16067]: 6AC7A22009F: from=root@ubu001-ProLiant-ML110-G5, size=644, nrcpt=1 (queue active) Jul 3 10:09:01 ubu001-ProLiant-ML110-G5 postfix/local[16096]: 6AC7A22009F: to=root@ubu001-ProLiant-ML110-G5, orig_to=, relay=local, delay=0.13, delays=0.09/0.01/0/0.04, dsn=2.0.0, status=sent (delivered to mailbox) Jul 3 10:09:01 ubu001-ProLiant-ML110-G5 postfix/qmgr[16067]: 6AC7A22009F: removed

— Reply to this email directly or view it on GitHub https://github.com/pabloa/grafana-alerts/issues/6#issuecomment-118282770 .

bbenichou commented 9 years ago

HI @pabloa,

I double checked my grafana_alerts.cfg: everything is set properly and I have no problem to send emails using telnet.

However I believe there is a configuration issue somewhere.

When "POSTFIX" is uninstalled I got the following logs in syslog: Jul 3 11:21:01 ubu001-ProLiant-ML110-G5 CRON[19330]: (root) CMD (grafana_alerts) Jul 3 11:21:01 ubu001-ProLiant-ML110-G5 CRON[19329]: (CRON) info (No MTA installed, discarding output)

When "POSTFIX" is up and running it tries to send an email using "root@ubu001-ProLiant-ML110-G5" and did not take "grafana_alerts.cfg" setting into account.

Should I try another MTA?

Thanks, Ben

pabloa commented 9 years ago

I have it running using a postfix server located in other machine . I am using smtp without authentication. I tested it with a Google smtp server and it works too. Based in your feedback I suspect the issue is related perhaps to a different behavior of mail python libraries when a local mail server is used. I will review the docs. Could you please configure it to send emails using a smtp server running in a different machine? Or using Google smtp? Let me know how it goes

Pablo On Jul 6, 2015 2:03 AM, "bbenichou" notifications@github.com wrote:

HI @pabloa https://github.com/pabloa,

I double checked my grafana_alerts.cfg: everything is set properly and I have no problem to send emails using telnet.

However I believe there is a configuration issue somewhere.

When "POSTFIX" is uninstalled I got the following logs in syslog: Jul 3 11:21:01 ubu001-ProLiant-ML110-G5 CRON[19330]: (root) CMD (grafana_alerts) Jul 3 11:21:01 ubu001-ProLiant-ML110-G5 CRON[19329]: (CRON) info (No MTA installed, discarding output)

When "POSTFIX" is up and running it tries to send an email using "root@ubu001-ProLiant-ML110-G5" and did not take "grafana_alerts.cfg" setting into account.

Should I try another MTA?

Thanks, Ben

— Reply to this email directly or view it on GitHub https://github.com/pabloa/grafana-alerts/issues/6#issuecomment-118779728 .

bbenichou commented 9 years ago

Ideally I would like to use a distant windows smtp server or even a Google smtp server.

The thing is on both case - windows and Gmail - it doesn't work and I get (CRON) info (No MTA installed, discarding output) in the syslog. Then if I install a MTA like postfix or sendmail it tries to send the alerts emails from these local smtp server, which is not what I want.

Basically it's like my conf in grafana_alerts.cfg is never taken into account.

I'm surely missing something but can't figure out what.

Ben