Link to home
Start Free TrialLog in
Avatar of Michael Worsham
Michael WorshamFlag for United States of America

asked on

Configuring Nagios to send e-mail through external Postfix server

Is there a set of instructions or a basic 'how-to' for configuring Nagios to send notification e-mails through a external e-mail server that uses Postfix/Dovecot? Our Postfix environment is configured for SSL/TLS encryption, thus we require all external accounts to login before sending e-mail, thus the environment is not just a simple relay.

OS Platform: RHEL 5.5
Nagios Version: 3.2.3
Avatar of Deepak Kosaraju
Deepak Kosaraju
Flag of United States of America image

set the relay host inside /etc/postfix/main.cf to the hostname of your mail server in your platform:
relayhost = hostname.$mydomain
Oh sorry my bad i should have read the complete question.
Avatar of Sanga Collins
i believe you would need to setup sendmail or postfix on the nagios server and configure it for authentication based relay.
here is the guide i use for postfix smtp authentication relay. It cover TLS which you will need since your main server uses SSL/TLS authentication
Avatar of Michael Worsham

ASKER

@sangamc Due to DISA/STIG requirements, installation of Postfix/sendmail on the originating (monitoring) server isn't allowed. It must use an external e-mail server already configured for SSL/TLS and part of the AD/LDAP and DNS infrastructure.
You will need some way to get the email from the nagios server to the external email server. According to nagios documentation you must install some form of mail utility to accomplish this. There is one other way i can think of however. Since the nagios mail command just runs a printf and the sends that result to postfix, you can modify ti to printf to a file in a predetermined directory, and have the external mail server run a script on a 5 minute schedule for example to connect to the nagios server and pull any notifications that may have been saved in that directory and then send them.
i am not familiar with the details of DISA/STIG requirements, but wouldnt a workstation configured with outlook connecting to the external server be the exact same thing. all nagios does in a relay scenario is act like a workstation sending outgoing mail. without the external server it will not be sending mail.
@sangamc - suggestion make sense but #mwecomputers its worth getting approval to install either postfix r sendmail agents on nagios server secure it tight just to allow the relay traffic to the mail server, this can give u the accuracy on the time of alerts and could save you lot of time.
@sangamc - In your previous post I think you forgot to share the guid to use postfix smtp auth relay procedure.
Well I consulted the powers that be. They would allow postfix or sendmail to be installed, just not actively running (listening) on the monitoring server. They stated that ALL messages from ANY monitoring server that could send e-mail to both internal and external domains be passed through the only allowable 'message/relay' server, which is already configured and running SSL/TLS encryption and registered with a DNS A, MX and PTR record.

ASKER CERTIFIED SOLUTION
Avatar of Sanga Collins
Sanga Collins
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial