Nagios not creating or sending emails


Hello everyone, I’m fairly new to Nagios and I’ve managed to configure everything as I want it to be but Nagios isn’t creating alert emails or sending me over to my email address.
I’m running it on Suse Linux 10.1. This machine is purely configured for Nagios and by the looks of it Suse Linux is using Postfix instead of Sendmail and when I do
/etc/rc.d/postfix status
It tells me that postfix is running
I haven’t changed anything in commands.cfg file and here’s a copy - paste of what its in.

‘host-notify-by-email’ command definition

define command{
command_name host-notify-by-email
command_line /usr/bin/printf “%b” “***** Nagios 2.7 *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n” | /usr/bin/mail -s “Host $HOSTSTATE$ alert for $HOSTNAME$!” $CONTACTEMAIL$

‘notify-by-email’ command definition

define command{
command_name notify-by-email
command_line /usr/bin/printf “%b” “***** Nagios 2.7 ***\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mail -s " $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **” $CONTACTEMAIL$
This is what I’ve got configured in my minimal.cfg file.

define contact{
contact_name nagios
alias Nagios
service_notification_period 24x7
host_notification_period 24x7
service_notification_options w,u,c,r
host_notification_options d,r
service_notification_commands notify-by-email
host_notification_commands host-notify-by-email
email my email address where I want the nagios alerts to go to

When I send a test email to my workstation from command line using either mail or nail command, I receive the email within seconds. I really don’t have a clue where the problem lies so please help.


I’ve just installed mini_sendmail in a hope to sort out the email problem on my Suse/Nagios server. All I want to do is to get email alerts from Nagios to my email address which is on Exchange server.
mini_sendmail is installed in /usr/local/sbin/mini_sendmail
but I don’t have a clue how I’m going to configure it. I’ve removed sendmail and postfix from my Suse Linux 10.1 before istalling mini_sendmail. Please help.


Run the command below by hand, and you might find that mail is not located in /usr/bin. Change $contactemail$ to your addy.

/usr/bin/printf “%b” “***** Nagios 2.7 ***\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mail -s " $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **” $CONTACTEMAIL$


Thanks for your reply mate, I’ve done it and I got the email sent to me straightaway!