Newbie problem: Notifications are not being sent out
Scott Johnson
scott at nami.org
Mon Oct 31 20:05:18 CET 2005
I'm working on getting a nagios install up at my workplace and have run
into a problem I can't figure out: e-mail notices are not being sent
out. I'm using v2.0b4 on a Fedora Core 4 install. I have not altered the
sendmail config files in any way (I don't **THINK** I need to).
The install works and properly tests our various "live" hosts. The
website displays information correctly. There's just no e-mail going
out.
For testing, I created a host file for a machine that doesn't exist.
This ensures all the nagios tests will fail without requiring me to take
down a real server. Here's what I get in the logs:
LOG FILE ENTRIES:
=================
[1130527025] SERVICE ALERT: fail tester;Web Server;CRITICAL;SOFT;2;No
route to host
[1130527085] SERVICE ALERT: fail tester;Web Server;CRITICAL;SOFT;3;No
route to host
[1130527145] SERVICE ALERT: fail tester;Web Server;CRITICAL;HARD;4;No
route to host
>From my reading of the archives and various FAQs, there's supposed to be
an ACTION entry in there somewhere. This makes me think I've turned
something off, but I can't figure out where. All relevant cfg files
(that I could think of) are below. The test fails properly (against the
nonexistent host) when I run it on the command line, and the
"notify-by-email" command works when I enter that at the command line.
It *does* appear to have tried e-mailing SOMETHING early on in the
testing, but seems to have been unable to substitute values for the
variables (it sent two messages, and no more, to $@[host], with all the
other variables also seeming to be null).
I'm hoping this is a straightforward "dur, change this" sort of problem.
Apologies in advance if this is in a FAQ or archive message somewhere.
If so just send me the link and I'll be on my way. Thanks in advance for
any help you can provide!
SERVICE DEFINITION:
=======================
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
problems)
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
register 0 ; DONT REGISTER THIS
DEFINITION - ITS NOT A REAL SERVICE, JUST A TEMPLATE!
}
define service{
use generic-service ; Name
of service template to use
host_name fail tester
service_description Web Server
is_volatile 0
check_period 24x7
max_check_attempts 4
normal_check_interval 5
retry_check_interval 1
contact_groups IT-admin
notification_interval 15
notification_period 24x7
check_command check_http!failtester.[domain]![ip #]
}
CONTACT DEFINITION:
=====================
define contactgroup{
contactgroup_name IT-admin
alias Main Admins
members scott
}
define contact{
contact_name scott
alias NAMI network administrator
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 scott@[domain]
}
HOST DEFINITION:
==================
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
register 0 ; DONT REGISTER THIS
DEFINITION - ITS NOT A REAL HOST, JUST A TEMPLATE!
}
define host {
host_name fail tester
use generic-host ; Name of host template to use
alias A machine that doesn't exist
address [IP #]
max_check_attempts 3
check_period 24x7
contact_groups IT-admin
notification_interval 60
notification_period 24x7
notification_options d,u,r
}
EMAIL COMMAND:
===================
# 'notify-by-email' command definition
define command{
command_name notify-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$OUTPUT$" | /bin/mail -s "**
$NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$
**" $CONTACTEMAIL$
}
########################################################################
######
#
# NAGIOS.CFG - Sample Main Config File for Nagios
log_file=/usr/local/nagios/var/nagios.log
cfg_file=/usr/local/nagios/etc/hosts.cfg
cfg_file=/usr/local/nagios/etc/timeperiod.cfg
cfg_file=/usr/local/nagios/etc/contacts.cfg
cfg_file=/usr/local/nagios/etc/command.cfg
cfg_file=/usr/local/nagios/etc/commands2.cfg
cfg_file=/usr/local/nagios/etc/hostgroups.cfg
cfg_dir=/usr/local/nagios/etc/servers
object_cache_file=/usr/local/nagios/var/objects.cache
resource_file=/usr/local/nagios/etc/resource.cfg
status_file=/usr/local/nagios/var/status.dat
nagios_user=nagios
nagios_group=nagios
check_external_commands=1
command_check_interval=-1
command_file=/usr/local/nagios/var/rw/nagios.cmd
comment_file=/usr/local/nagios/var/comments.dat
downtime_file=/usr/local/nagios/var/downtime.dat
lock_file=/usr/local/nagios/var/nagios.lock
temp_file=/usr/local/nagios/var/nagios.tmp
event_broker_options=-1
log_rotation_method=d
log_archive_path=/usr/local/nagios/var/archives
use_syslog=1
log_notifications=1
log_service_retries=1
log_host_retries=1
log_event_handlers=1
log_initial_states=0
log_external_commands=1
log_passive_checks=1
service_inter_check_delay_method=s
max_service_check_spread=30
service_interleave_factor=s
host_inter_check_delay_method=s
max_host_check_spread=30
max_concurrent_checks=0
service_reaper_frequency=10
auto_reschedule_checks=0
auto_rescheduling_interval=30
auto_rescheduling_window=180
sleep_time=0.25
service_check_timeout=60
host_check_timeout=30
event_handler_timeout=30
notification_timeout=30
ocsp_timeout=5
perfdata_timeout=5
retain_state_information=1
state_retention_file=/usr/local/nagios/var/retention.dat
retention_update_interval=60
use_retained_program_state=1
use_retained_scheduling_info=0
interval_length=60
use_aggressive_host_checking=0
execute_service_checks=1
accept_passive_service_checks=1
execute_host_checks=1
accept_passive_host_checks=1
enable_notifications=1
enable_event_handlers=1
process_performance_data=0
obsess_over_services=0
check_for_orphaned_services=0
check_service_freshness=1
service_freshness_check_interval=60
check_host_freshness=0
host_freshness_check_interval=60
aggregate_status_updates=1
status_update_interval=15
enable_flap_detection=0
low_service_flap_threshold=5.0
high_service_flap_threshold=20.0
low_host_flap_threshold=5.0
high_host_flap_threshold=20.0
date_format=us
p1_file=/usr/local/nagios/bin/p1.pl
illegal_object_name_chars=`~!$%^&*|'"<>?,()=
illegal_macro_output_chars=`~$&|'"<>
use_regexp_matching=0
use_true_regexp_matching=0
admin_email=nagios
admin_pager=pagenagios
daemon_dumps_core=0
# EOF (End of file)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20051031/5fe1710c/attachment.html>
More information about the Users
mailing list