[SOLVED] help required with nagios email notifications
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
In order to get the email notifications working you'll need to direct the mail to a real email server. Do you have that setup on your server too? Or do you want to relay the mails to an external mail server using a MTA like postfix? Looks like you're just sending to local mail server. You'll need at least a server set up to accept those mails and then the tools to read them, being command line or via pop/imap/web protocol.
Ok, postfix can do the job if you configure it correctly. To what external server are you going to relay? Gmail, Yahoo, Hotmail? If one of these, are you behind a static WAN IP? The reason I ask this is because the mentioned email servers don't accept relaying from dynamic IP, so you might have to use some tricks. If relaying to for example you're own company's mailserver then it should be easy enough to set up.
Then there are two parts you have to take into account. First you'll have to relay all the mail on your nagios server to the mailserver of your company. Second you'll have to tell your mailserver to accepts mails coming from your nagios server.
The main.cf (postfix main configuration file) should hold something like this:
I edited the main.cf file, restarted postfix, restarted nagios and then forced an alarm from one of the hosts, in the log I got the following entry:
an 3 18:13:07 John-Ubuntu postfix/cleanup: fatal: open database /etc/postfix/canonical.db: No such file or directory
Jan 3 18:13:08 John-Ubuntu postfix/master: warning: process /usr/lib/postfix/cleanup pid 27266 exit status 1
Jan 3 18:13:08 John-Ubuntu postfix/master: warning: /usr/lib/postfix/cleanup: bad command startup -- throttling