0

Alert mailing is configured from a gmail id to avoid spam catchup. Nagios alert mailing is working fine while trying manually using 'mail' command. Which clearly means, nagios is capable of sending mails to company mail as well as outer domains now. But it is not sending any mails at all. At the same time, I can see it is trying to initiate mail alerts while any alerts are detected also...!

Which is clear from 'nagios.log'

[1441281845] SERVICE NOTIFICATION: nagiosadmin;bbnlbwmon;HTTPS Response Time;CRITICAL;notify-service-by-email;Connection refused[1441281850] SERVICE NOTIFICATION: nagiosadmin;arkr-dc-sw1;Port 6 connected to transmedia with access vlan 103;CRITICAL;notify-service-by-email;SNMP CRITICAL - down(2)

But still, an error is thrown by mail logs which is preventing Nagios from sending alert mails. Which reads ' procmail -a "$EXTENSION"'

Please check 'mail.log'

Sep 3 15:46:01 nagios postfix/local[2835]: 66D69360533:to=, relay=local, delay=71029, delays=71029/0 /0/0.04, dsn=2.0.0, status=sent (delivered to command: procmail -a $EXTENSION")

Sep 3 15:46:03 nagios postfix/local[2759]: 6924A360548:to=, relay=local, delay=77269, delays=77261/0/0/8.1, dsn=2.0.0, status=sent (delivered to command: procmail -a "$EXTENSION")

What could possibly be "status=sent (delivered to command: procmail -a "$EXTENSION")" error..?

Another unusual thing is, while sending E-Mails manually, it is not getting written in the /var/log/mail.log.

Kindly update.

1

your postfix deliver mail locally to procmail. That is postfix status status=sent but your procmail is not configured properly or have some errors and can not deliver mails.

Do:

sudo dpkg-reconfigure postfix

1) Choose 'Internet with smarthost' (recommended) to use another mail server for relaying mail or 'Internet Site'

2) Enter system mail name (node1.foo.tld)

3) Enter SMTP relay host (mail.foo.tld)

4) Root and postmaster mail recipient (myemail@address.com)

5) Other destinations to accept mail for (node1.foo.tld, localhost.foo.tld, localhost)

6) Force synchronous updates on mail queue (No)

7) Local networks (127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128)

8) Use procmail for local delivery (Yes)

9) Mailbox size limit (bytes) (0)

10) Local address extension character (+)

11) Internet protocols to use (ipv4 is the safe choice)

Configuration on this way is simple and enough to send notification from nagios anywhere.

Edit 2

sendmail configuration as a smart host

The SMART_HOST macro allows you to specify the host that should relay all outgoing mail that you are unable to deliver directly, and the mail transport protocol to use to talk to it.

Open your configuration file:

 sudo nano /etc/mail/sendmail.mc

Append or modify macro that read as follows :

 define(`SMART_HOST',`smtp.blabla.com')

Replace smtp.blabla.com with your actual smtp server address.

If line contains word, dnl remove the dnl word.

Regenerate a new sendmail.cf config file with m4 command:

 sudo m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

Restart sendmail service

|improve this answer|||||
  • : Okay, but Postfix had been uninstalled before and sendmail is running now. How can I deconfigure Postfix from Nagios, so that it no longer uses any postfix services and uses only Sendmail? – kiran bbnl Sep 3 '15 at 14:37
  • In question you give logs from postfix. Sep 3 15:46:03 nagios postfix/local not sendmail. Kill sendmail is to robust. Install postfix. – 2707974 Sep 3 '15 at 14:42
  • I had removed sendmail from system and installed postfix. But when trying to send mail manually using 'mail' command, it is spitting an error "postdrop: warning: unable to look up public/pickup: No such file or directory" ... Is there anyway I can stick on to sendmail? – kiran bbnl Sep 3 '15 at 15:52
  • I edit my answer. Step 8, for local delivery. – 2707974 Sep 3 '15 at 19:14
  • I add sendmail configuration – 2707974 Sep 3 '15 at 19:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.