Page 1 of 2

Mail Stopped working...

Posted: Thu Apr 18, 2013 2:30 am
by ruffsense
Can anyone help me out...

I will start from the top....my (commands.cfg)

Code: Select all

define command {
	command_name                   	notify-host-by-email
	command_line                   	/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
	register                       	1
}	

define command {
	command_name                   	notify-service-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: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
	register                       	1
}	
my(conatcts.cfg)

Code: Select all

define contact {
        contact_name                    helpdesk
        alias                           Helpdesk
        host_notifications_enabled      1
        service_notifications_enabled   1
        host_notification_period        24x7
        service_notification_period     24x7
        host_notification_options       d,u,r,f,s
        service_notification_options    w,u,c,r,f,s
        host_notification_commands      notify-host-by-email
        service_notification_commands   notify-service-by-email
        email                           [email protected]
        use                             generic-contact
        register                        1
        }
my(contactgroups.cfg)

Code: Select all

define contactgroup {
        contactgroup_name               admins
        alias                           Nagios Administrators
        members                         helpdesk
        register                        1
}
Still is my mail que empty...

Code: Select all

# sendmail -bp
/var/spool/mqueue is empty
                Total requests: 0
Is there something im missin'?

Re: Mail Stopped working...

Posted: Thu Apr 18, 2013 9:43 am
by slansing
Can you verified that either the contactgroup displayed, or the contact itself is attached to a host/service that went into a state change that it will notify on?

Re: Mail Stopped working...

Posted: Thu Apr 18, 2013 1:20 pm
by ruffsense
slansing wrote:Can you verified that either the contactgroup displayed, or the contact itself is attached to a host/service that went into a state change that it will notify on?
Im a bit a newbie but where can i check that?

Re: Mail Stopped working...

Posted: Thu Apr 18, 2013 3:24 pm
by ruffsense
do you mean the nagios.cfg?

cgi_file?

Re: Mail Stopped working...

Posted: Fri Apr 19, 2013 3:41 am
by gshergill
Hi ruffsense,

He means in one of your .cfg files (services.cfg, hosts.cfg, templates.cfg, or wherever you have defined it), can you verify that the contact/contact_group given is attached to the host which went down, i.e. the host you wanted to see the notification for.

Was your notification mails working before?

Thank you.

Kind Regards,

Gary Shergill

Re: Mail Stopped working...

Posted: Fri Apr 19, 2013 2:37 pm
by scottwilkerson
Correct.

ruffsense, can you post the .cfg for the host/service you expect to get mail for.

Thanks.

Re: Mail Stopped working...

Posted: Mon Apr 22, 2013 2:35 pm
by ruffsense
scottwilkerson wrote:Correct.

ruffsense, can you post the .cfg for the host/service you expect to get mail for.

Thanks.
They are good. The problem seems that the /var/mail/nagios is empty

Re: Mail Stopped working...

Posted: Mon Apr 22, 2013 3:03 pm
by abrist
In the core interface, are there any recent notifications listed in the "notifications" page?

Re: Mail Stopped working...

Posted: Mon Apr 22, 2013 3:41 pm
by ruffsense
abrist wrote:In the core interface, are there any recent notifications listed in the "notifications" page?
Nope is there away i can test the mail in nagios by creating a fake warning are problem?

Re: Mail Stopped working...

Posted: Mon Apr 22, 2013 4:20 pm
by slansing
You can visit the service details page of one of your services and use the "Send custom service notification" button to send a test notification, this will be sent to contacts assigned to the configuration file.