Solved Zabbix - email alerts
-
@scottalanmiller said in Zabbix - email alerts:
Let's stick to testing one thing at a time. Don't hit one hiccup and start ripping and replacing the entire email system. Chances are we are dealing with something really simple, like Zabbix isn't trying to send email or isn't trying to use the MTA. If we have to put SMTP details into Zabbix, it seems like it is trying to send directly without Postfix, otherwise it would use the Postfix settings, right?
I agree.
-
@Mike-Davis said in Zabbix - email alerts:
That was to make sure that no firewalls or anything were getting in the way. That said, when I checked the headers, it didn't seem to connect directly to the o365 connector where I expected it to.
Where did you expect it to? Should be TLS on Port 25.
-
Before we head down any rabbit holes, change the settings in Zabbix to send to port 25 on the local machine.
-
@scottalanmiller said in Zabbix - email alerts:
That was to make sure that no firewalls or anything were getting in the way. That said, when I checked the headers, it didn't seem to connect directly to the o365 connector where I expected it to.
Where did you expect it to? Should be TLS on Port 25.
scratch that. It did connect to protection.outlook.com
I don't think TLS is needed because the connector in o365 is just set to allow the connection by IP address.
-
@Mike-Davis said in Zabbix - email alerts:
@scottalanmiller said in Zabbix - email alerts:
That was to make sure that no firewalls or anything were getting in the way. That said, when I checked the headers, it didn't seem to connect directly to the o365 connector where I expected it to.
Where did you expect it to? Should be TLS on Port 25.
scratch that. It did connect to protection.outlook.com
I don't think TLS is needed because the connector in o365 is just set to allow the connection by IP address.
But Postfix is not configured for that, right? Only Zabbix is?
-
@scottalanmiller said in Zabbix - email alerts:
Before we head down any rabbit holes, change the settings in Zabbix to send to port 25 on the local machine.
so just set SMTP server to: localhost ?
-
@Mike-Davis said in Zabbix - email alerts:
@scottalanmiller said in Zabbix - email alerts:
Before we head down any rabbit holes, change the settings in Zabbix to send to port 25 on the local machine.
so just set SMTP server to: localhost ?
Yes, my guess is that it will just work. Right now you have it set to bypass Postfix (which you tested as working) and attempt to connect directly to O365. Which might work, but isn't tested. The MTA (Postfix) should just work and is sitting there waiting for mail to try to deliver. So my guess is that it will just work.
-
I made that change this morning and didn't get any emails, but I have to wonder if it's because no new triggers have been tripped or if it's not kicking out emails. I've tried to tweak some of the triggers so it would send a new alert, but nothing so far.
-
That makes it hard to test. No way to prompt an email test?
-
@scottalanmiller said in Zabbix - email alerts:
No way to prompt an email test?
I can't seem to find one.
-
Well that sucks. I guess we just wait, now
-
Couldn't you create a file on a host and make zabbix monitor that file, so when you manually erase the file and it will trigger an email?
That would be a manual way to test it in my opinion.
-
Using vfs.file.exists maybe?
-
@Romo said in Zabbix - email alerts:
Couldn't you create a file on a host and make zabbix monitor that file, so when you manually erase the file and it will trigger an email?
In one example I saw them spike the CPU on a linux box. During the day I couldn't do it, but now that it's off hours I fired up prime95 on one of the Windows Servers. I'll let the CPU sit pegged for a while and see if anything happens when the alert is triggered.
-
Well this is embarrassing. CPU has been at 100% for 15 minutes and Zabbix doesn't think it has increased at all. The disk space numbers seem to be accurate and I have a few servers over the 20% trigger for free space, so maybe I'll adjust the trigger and then see if an alert is generated.
-
Don't know why I didn't think of this earlier, but there is a trigger for "no data received for 5 minutes." Since all my windows boxes are running the Zabbix agent, I just stopped the service on one and waited. Sadly, no email, but I can see the trigger worked on the dashboard.
-
How do I figure out what email server Zabbix is using? It would make sense that it's postfix since when I run:
service postfix status
it tells me that the service is active and running. On the other hand is postfix standard with any CentOS install?
I looked over the documentation on:
https://www.zabbix.com/documentation/3.2/manual/config/notifications/media/emailand I don't see anything that tells me what Zabbix is looking for under the hood.
-
@Mike-Davis said in Zabbix - email alerts:
and I don't see anything that tells me what Zabbix is looking for under the hood.
It's looking for the local MTA on port 25. Only one service can be the port 25 MTA for the box. That Postfix is running suggests that, but doesn't prove it. But we know that Postfix is listening on port 25, so you know it is Postfix.
Yes, Postfix is standard just about everywhere, it won the MTA wars by far. It's also what we prefer from decades of use.
But this isn't a Linux thing, this is just basic networking. Whatever is listening on port 25 is your email service.
-
@Mike-Davis said in Zabbix - email alerts:
and I don't see anything that tells me what Zabbix is looking for under the hood.
That's because it looks for what you tell it to look for in the email settings that you put in. Zabbix itself does nothing. When you configure to send to localhost port 25, you are telling it to look at the locally running MTA, which in this case is Postfix.
-
Did you look for the errors now that you are using the local Postfix MTA? Your errors are in there, and the fact that the errors are there tell you that Postfix is making the attempt to send email for you.
# cat maillog Feb 14 14:06:10 zabbix postfix/pickup[22265]: 2828F16A1: uid=1132 from=<mdavis> Feb 14 14:06:10 zabbix postfix/cleanup[23637]: 2828F16A1: message-id=<[email protected]> Feb 14 14:06:10 zabbix postfix/qmgr[1352]: 2828F16A1: from=<[email protected]>, size=309, nrcpt=1 (queue active) Feb 14 14:06:11 zabbix postfix/smtp[23639]: 2828F16A1: to=<[email protected]>, relay=ntg-co.mail.protection.outlook.com[207.46.163.74]:25, delay=0.87, delays=0.02/0.01/0.08/0.76, dsn=2.6.0, status=sent (250 2.6.0 <[email protected]> [InternalId=32027571128608, Hostname=BN3PR0801MB2257.namprd08.prod.outlook.com] 6701 bytes in 0.219, 29.877 KB/sec Queued mail for delivery) Feb 14 14:06:11 zabbix postfix/qmgr[1352]: 2828F16A1: removed