Hello,
I have a Nagios Core Version 3.2.3. When a service is stopped i get services notifications, but when a host is in down state or unrechable state i don´t recive any notification.
the configuration for define host is the folowing:
define host{
name generic-host
notifications_enabled 1
first_notification_delay 0
check_interval 5
retry_interval 1
event_handler_enabled 1
flap_detection_enabled 1
failure_prediction_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
notification_period 24x7
register 0
}
define host{
name local-server
use generic-host
check_period 24x7
max_check_attempts 10
check_command check-host-alive
notification_period 24x7
notification_interval 120
notification_options d,u,r
contact_groups soporte,managers,admins
register 0
}
Can some body help me?
Host Notifications.
Re: Host Notifications.
Hi,
I'don't see any error.
Could you check the nagios log? Is there a notification log?
The problem can be on contact definition or on host_notification_commands.
Could you post log and other information?
Regards
Ivan
I'don't see any error.
Could you check the nagios log? Is there a notification log?
The problem can be on contact definition or on host_notification_commands.
Could you post log and other information?
Regards
Ivan
Re: Host Notifications.
Hi Ivan,
Thanks for help me, my configuration in host_notification_command:
# 'host-notify-by-email' command definition
define command{
command_name host-notify-by-email
command_line /usr/bin/printf "%b" "***** Nagios 2.10 *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $H
OSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /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.10 *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nServic
e: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAddit
ional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE
$ **" $CONTACTEMAIL$
}
but the problem is not in the sending email, i don´t get any notifications for host events in the Nagios Core ("No notifications have been recorded in the current log file").
Any idea, why only get notifications from services events and not from host events?
Regards,
Thanks for help me, my configuration in host_notification_command:
# 'host-notify-by-email' command definition
define command{
command_name host-notify-by-email
command_line /usr/bin/printf "%b" "***** Nagios 2.10 *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $H
OSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /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.10 *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nServic
e: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAddit
ional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE
$ **" $CONTACTEMAIL$
}
but the problem is not in the sending email, i don´t get any notifications for host events in the Nagios Core ("No notifications have been recorded in the current log file").
Any idea, why only get notifications from services events and not from host events?
Regards,
Re: Host Notifications.
Both of those host definitions you have posted have register 0 set... this marks the definition as a template, so unless the template local-server is inherited by something there will be no check_command definitition set.
Re: Host Notifications.
Hi jsmurphy,
Yes, the template local-server is inherited by others hosts.
Yes, the template local-server is inherited by others hosts.