Showing results for 
Search instead for 
Did you mean: 

Postfix or Nagios issue?

Go to solution
Super Advisor

Postfix or Nagios issue?


I am using postfix(sendmail) to send alerts from Nagios. Currently the box has a local account through which Nagios sends an alert(email) and it sends to the same userid(nagios), from nagiosuser---email-to--->nagiosuser.

nagiosuser has an alias which forwards mails to my personal company email account.

Going through the Nagios logs I am able to see that Nagios sent the alert but I havent been getting email alerts at all.

From commandline the mail is sent and also through Nagios sometimes I do get the email but not always.

How do I debug this issue and I am thinking of asking my email admin to see if they are filtering my emails in anyway from the nagiosuer. Is this a correct route?

Honored Contributor

Re: Postfix or Nagios issue?

First, when you see Nagios has sent an alert but you haven't received it, run "mailq" on the Nagios/Postfix box to see if the message is still in Postfix's outbound queue.

Possible reasons for not sending the message immediately could be:
- problems resolving the destination server name using DNS
- problems connecting to the destination server

Look in /var/mail/ and /var/mail/root. Are there delivery failure messages from MAILER-DAEMON? If so, these usually describe the problem rather thoroughly.

You should also read the mail logs (normally /var/adm/syslog/mail.log in HP-UX) to see where Postfix attempted to deliver the message and what was the result.

Has your Nagios/Postfix box been registered to your local DNS properly? For example, if you run "nslookup" on any other system, do you get back the name of the Nagios box? Many spam filters will summarily discard any messages coming from mail servers that don't have a proper DNS registration.

When you successfully send a message from command line, look at the headers of the message (the "Internet headers" option in Outlook). The chain of "Received:" headers should tell you exactly which servers the message passed through on the way to your company email account. Sometimes mail servers add other information too: notifications like "(may be forged)" are not too good.

When you have all this information, you can make it easier for the mail administrator to track down what is happening to your messages.

Super Advisor

Re: Postfix or Nagios issue?

Thanks MK for the detailed reply.

The issue is fixed as it turned out to be that I had to make postfix aware of the fact that the email was being sent locally so that it does not go out to the relay servers to find out that information which wasn't available.