I’m in the process of setting up Nagios 3 on CentOS and so far all has gone really well. However, I’ve now run into a problem where I just can’t get my head around email notifications.
Basically, I’m at a loss as to what the best way to set this up is. I notice that sendmail is installed by default but I can’t get to grips with using this at all.
I’ve also seen posts where people have used mailx, which I have also tried, but just can’t get anything to work (and I don’t know if mailx and sendmail are actually the same thing or not).
We just have one Nagios server that we need to send email alerts internally to the tech team, and we have an exchange server, so it’s not a complex setup. I’ve had a good look for documentation but there’s precious little in the way of idiots guides on this (that I can see).
Any help or info or some basic steps to get this working would be really appreciated.
You will have to configure your exchange server to accepted relaying from your nagios box as well. I don’t run Exchange so I have no idea on how that is done.
Hello, I am in much the same boat as neild. We have an exchange server and another server running Ubuntu 8.10 server edition with Nagios 3. I don’t want to use the exchange server to send out the notifications as monitoring the exchange server is largely the reason why we are using Nagios in the first place.
I’ve followed the Ubuntu quick start and nagios is working just fine, just not the email notification part.
I’ve installed mailx per quick start guides and changed /usr/local/nagios/etc/objects/commands.cfg ‘/bin/mail’ references to ‘/usr/bin/mail’.
Nathan, you need to configure postfix and make sure you can send mail via terminal before troubleshooting/configuring the commands.cfg. For Ubuntu, your commands looks fine, make sure you have templates.cfg, contacts.cfg and command.cfg correctly configured. I also like to edit the nagios.cfg and change the $adminemail$ to my own and replace $contactemail$ with it.
[blockquote]I’ve installed mailx per quick start guides and changed /usr/local/nagios/etc/objects/commands.cfg ‘/bin/mail’ references to ‘/usr/bin/mail’.[/blockquote] No you didn’t… look…
As mentioned before no other changes have been made to the server other then those specified in the quickstart guide. I feel like I am missing a step somewhere.
Sorry first of all for posting this then not replying to the comments that people have put. I actually managed to get this working in the end, so will update the thread with what I found.
Basically, what worked for me in the end was changing the /usr/bin/mail -s option to just mail -s and this worked. I did have it working with sendmail at the end first off, but this wasn’t entering any text in the subject or body of the alerts, so wasn’t a great solution (I’m not sure if that was me getting it wrong or just sendmail not being able to).