I apologize if I am taking over this thread but I am in the same boat!!
I cannot for the life of me get an email to hit my exchange.
The Nagios server IP address is a "allowed" address in the Exch and i can send an email via telnet from the console
Config files are as follows:
define host{
use windows-server ; Inherit default values from a template
host_name cc-fl-dc2 ; The name we're giving to this host
alias Secondary DC ; A longer name associated with the host
address 192.168.26.15 ; IP address of the host
hostgroups dell-servers
contact_groups admins
}
define service{
use generic-service
host_name cc-fl-dc2
service_description NSClient++ Version
contact_groups admins
check_command check_nt!CLIENTVERSION
}
# hostgroup for Dell servers
define hostgroup {
hostgroup_name dell-servers
alias Our Company Name
members cc-fl-dc2
}
define contact{
contact_name My Name
use generic-contact
alias My Name
email
[email protected]
}
define contactgroup{
contactgroup_name admins
alias Administrators
members My Name
}
Contact Template:
# Generic contact definition template - This is NOT a real contact, just a template!
define contact{
name generic-contact ; The name of this contact template
service_notification_period 24x7 ; service notifications can be sent anytime
host_notification_period 24x7 ; host notifications can be sent anytime
service_notification_options w,u,c,r,f,s ; send notifications for all service states, flapping events, and scheduled downtime events
host_notification_options d,u,r,f,s ; send notifications for all host states, flapping events, and scheduled downtime events
service_notification_commands notify-service-by-email ; send service notifications via email
host_notification_commands notify-host-by-email ; send host notifications via email
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE!
}
Commands.cfg (i have tried usr/bin/mail /bin/mail usr/bin/mailx /bin/mailx):
# 'notify-host-by-email' command definition
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" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}
# 'notify-service-by-email' command definition
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$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
Could someone please enlighten me this has been driving me nuts for days now!!!! (And nights too)
Thanks in advance