Newbie Notifications Problem
Ray Wadkins
rwadkins at tervela.com
Fri Sep 21 22:00:36 CEST 2007
We've set up Nagios for the first time here. Version 3.0b2. We've set
up several hosts and services. But we're not receiving any
notifications and I can't figure out why. The service and host details
all show "Last Notification: N/A (notification 0)". The
notify-service-by-email command works from the command line as the
nagios user. I'll try to include as many relevant config sections as
possible below.
The box is CentOS 4.5 running Linux version 2.6.9-55.0.2.ELsmp.
There doesn't seem to be any debug information for notifications, so I
can't tell if the notifications are being blocked by something I haven't
looked at. I wish there was a logging option that allowed me to audit
the notification filters, or at least a "test notification" feature.
(if these things are there, someone tell me where and I'll admit I'm an
'idiot').
I appreciate any help that can be given.
>From Contact.cfg:
define contact{
contact_name mdsouza_e ; Short
name of user
use generic-contact ;
Inherit default values from generic-contact template (defined above)
alias Marvin D'Souza ; Full
name of user
email XXXXX ; <<***** CHANGE THIS
TO YOUR EMAIL ADDRESS ******
}
define contact{
contact_name rwadkins_e ; Short
name of user
use generic-contact ;
Inherit default values from generic-contact template (defined above)
alias Ray Wadkins ; Full
name of user
email XXXXX ; <<***** CHANGE THIS
TO YOUR EMAIL ADDRESS ******
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
}
define contactgroup{
contactgroup_name nyadmins
alias New York Administrators
members mdsouza_e, rwadkins_e
}
>From Windows.cfg:
define host{
use windows-server ; Inherit default values from a
template
host_name quickbooks ; The name we're giving to this host
alias quickbooks ; A longer name associated with the
host
address XXXXX ; IP address of the host
hostgroups allhosts,windows-servers
max_check_attempts 3
check_period workhours
notification_options d,r,u
notification_interval 1440
notification_period workhours
contact_groups nyadmins
}
define service{
use generic-service
host_name quickbooks
service_description QuickBooks Backup
check_command check_event_log
notification_options w,u,c,r
notification_interval 1440
notification_period workhours
contact_groups nyadmins
}
>From timeperiods.cfg
define timeperiod{
timeperiod_name workhours
alias Normal Work Hours
monday 08:00-18:00
tuesday 08:00-18:00
wednesday 08:00-18:00
thursday 08:00-18:00
friday 08:00-18:00
}
>From commands.cfg
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: $HOS
TALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
>From templates.cfg:
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!
}
define host{
name windows-server ; The name of this host
template
use generic-host ; Inherit default values
from the generic-host template
check_period 24x7 ; By default, Windows
servers are monitored round the clock
check_interval 5 ; Actively check the
server every 5 minutes
retry_interval 1 ; Schedule host check
retries at 1 minute intervals
max_check_attempts 10 ; Check each server 10
times (max)
check_command check-host-alive ; Default
command to check if servers are "alive"
notification_period 24x7 ; Send notification out
at any time - day or night
notification_interval 30 ; Resend notifications
every 30 minutes
notification_options d,r ; Only send
notifications for specific host states
contact_groups admins ; Notifications get sent
to the admins by default
hostgroups allhosts,windows-servers ; Host groups
that Windows servers should be a member of
register 0 ; DONT REGISTER THIS -
ITS JUST A TEMPLATE
}
define host{
name generic-host ; The name of
this host template
notifications_enabled 1 ; Host
notifications are enabled
event_handler_enabled 1 ; Host event
handler is enabled
flap_detection_enabled 1 ; Flap detection
is enabled
failure_prediction_enabled 1 ; Failure
prediction is enabled
process_perf_data 1 ; Process
performance data
retain_status_information 1 ; Retain status
information across program restarts
retain_nonstatus_information 1 ; Retain
non-status information across program restarts
notification_period 24x7 ; Send host
notifications at any time
register 0 ; DONT REGISTER
THIS DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}
define service{
name generic-service ; The
'name' of this service template
active_checks_enabled 1 ; Active
service checks are enabled
passive_checks_enabled 1 ;
Passive service checks are enabled/accepted
parallelize_check 1 ; Active
service checks should be parallelized (disabling this can lead to major
performance probl
ems)
obsess_over_service 1 ; We
should obsess over this service (if necessary)
check_freshness 0 ;
Default is to NOT check service 'freshness'
notifications_enabled 1 ;
Service notifications are enabled
event_handler_enabled 1 ;
Service event handler is enabled
flap_detection_enabled 1 ; Flap
detection is enabled
failure_prediction_enabled 1 ;
Failure prediction is enabled
process_perf_data 1 ;
Process performance data
retain_status_information 1 ; Retain
status information across program restarts
retain_nonstatus_information 1 ; Retain
non-status information across program restarts
is_volatile 0 ; The
service is not volatile
check_period 24x7 ; The
service can be checked at any time of the day
max_check_attempts 3 ;
Re-check the service up to 3 times in order to determine its final
(hard) state
normal_check_interval 10 ; Check
the service every 10 minutes under normal conditions
retry_check_interval 2 ;
Re-check the service every two minutes until a hard state can be
determined
contact_groups admins ;
Notifications get sent out to everyone in the 'admins' group
notification_options w,u,c,r ; Send
notifications about warning, unknown, critical, and recovery events
notification_interval 60 ;
Re-notify about service problems every hour
notification_period 24x7 ;
Notifications can be sent out at any time
register 0 ; DONT
REGISTER THIS DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}
>From nagios.cfg
# NOTIFICATIONS OPTION
# This determines whether or not Nagios will sent out any host or
# service notifications when it is initially (re)started.
# Values: 1 = enable notifications, 0 = disable notifications
enable_notifications=1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20070921/7791e9c8/attachment.html>
-------------- next part --------------
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
-------------- next part --------------
_______________________________________________
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