Email Notification using Postfix

Demetri Mouratis dmourati at cm.math.uiuc.edu
Tue Jun 21 19:33:36 CEST 2005


On Tue, 21 Jun 2005, Kindy Sylla wrote:

> Hello,
> I am having problems with email notifications and
> wondering if someone can help.
> I have the nagios running fine but no emails are sent
> out.
> This is my notify-by-mail command :
> # 'notify-by-email' command definition
> define command{
>         command_name    notify-by-email
>         command_line    /usr/bin/printf "%b" "*****
> Nagios   *****\n\nNotification Type:
> $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost:
> $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState:
> $SERVICESTATE$\n\nDate/Time: $DATETIME$\n\nAdditional
> Info:\n\n$OUTPUT$" | /usr/sbin/sendmail   -s "**
> $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$
> is $SERVICESTATE$ **" $CONTACTEMAIL$
>         }
> The log file doesn't contain any errors. I have the
> following line :
> [1119372445] SERVICE NOTIFICATION:
> Kindy;monediabackup;HTTP
> Service;CRITICAL;notify-by-email;Connection refused
>
>  I  am using postfix as MTA. Do I need to change
> something in postfix configurations files in order to
> get it working with nagios? Is there something else to
> do? Any idea can help!
> Thanks in advance!!!!
> Kindy

Try which sendmail from the root console.  Is the sendmail binary or link
there?  On my system, RHEL 3 ES, /usr/sbin/sendmail is a symlink to
/etc/alternatives/mta, and /etc/alternatives/mta is a symlink to
/usr/bin/sendmail.postfix.  (Sounds weird right?)

[root at nocmon2 root]# which sendmail
/usr/sbin/sendmail
[root at nocmon2 root]# ls -l /usr/sbin/sendmail
lrwxr-xr-x    1 root     root           21 Sep 10  2004 /usr/sbin/sendmail
-> /etc/alternatives/mta
[root at nocmon2 root]# file /etc/alternatives/mta
/etc/alternatives/mta: symbolic link to /usr/sbin/sendmail.postfix
[root at nocmon2 root]# ls -l /etc/alternatives/mta
lrwxrwxrwx    1 root     root           26 Feb 24 17:14
/etc/alternatives/mta -> /usr/sbin/sendmail.postfix
[root at nocmon2 root]# ls -l /usr/sbin/sendmail.postfix
-rwxr-xr-x    1 root     root        92424 Jun 29  2004
/usr/sbin/sendmail.postfix
[root at nocmon2 root]# rpm -qf /usr/sbin/sendmail.postfix
postfix-2.0.16-14.RHEL3

On RHEL 3 ES, you can use redhat-switch-mail from the GUI or the
following:

/usr/sbin/alternatives --set mta /usr/sbin/sendmail.postfix
/sbin/service sendmail stop
/sbin/service postfix start
/sbin/chkconfig sendmail off
/sbin/chkconfig postfix on

Hope that helps.
---------------------------------------------------------------------
Demetri Mouratis
dmourati at linfactory.com



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list