[Nagios-users] Newbie problem: Notifications are not being sent out
Nagios network monitoring software is enterprise server monitoring
Brought to you by:
egalstad,
sawolf-nagios
From: Scott J. <sc...@na...> - 2005-10-31 18:59:34
|
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).=20 =20 The install works and properly tests our various "live" hosts. The website displays information correctly. There's just no e-mail going out. =20 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: =20 LOG FILE ENTRIES: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D [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. =20 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).=20 =20 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! =20 SERVICE DEFINITION: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 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! } =20 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 #] } =20 =20 =20 CONTACT DEFINITION: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 define contactgroup{ contactgroup_name IT-admin alias Main Admins members scott } =20 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] } =20 HOST DEFINITION: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =20 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! } =20 define host { host_name fail tester use generic-host ; Name of host template to use alias A machine that doesn't exist=20 address [IP #] max_check_attempts 3 check_period 24x7 contact_groups IT-admin notification_interval 60 notification_period 24x7 notification_options d,u,r=20 } =20 =20 =20 EMAIL COMMAND: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D # '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$ } =20 ######################################################################## ###### # # NAGIOS.CFG - Sample Main Config File for Nagios=20 =20 log_file=3D/usr/local/nagios/var/nagios.log =20 cfg_file=3D/usr/local/nagios/etc/hosts.cfg cfg_file=3D/usr/local/nagios/etc/timeperiod.cfg cfg_file=3D/usr/local/nagios/etc/contacts.cfg cfg_file=3D/usr/local/nagios/etc/command.cfg cfg_file=3D/usr/local/nagios/etc/commands2.cfg cfg_file=3D/usr/local/nagios/etc/hostgroups.cfg =20 cfg_dir=3D/usr/local/nagios/etc/servers =20 object_cache_file=3D/usr/local/nagios/var/objects.cache =20 resource_file=3D/usr/local/nagios/etc/resource.cfg =20 status_file=3D/usr/local/nagios/var/status.dat =20 nagios_user=3Dnagios =20 nagios_group=3Dnagios =20 check_external_commands=3D1 =20 command_check_interval=3D-1 =20 command_file=3D/usr/local/nagios/var/rw/nagios.cmd =20 comment_file=3D/usr/local/nagios/var/comments.dat =20 downtime_file=3D/usr/local/nagios/var/downtime.dat =20 lock_file=3D/usr/local/nagios/var/nagios.lock =20 temp_file=3D/usr/local/nagios/var/nagios.tmp =20 event_broker_options=3D-1 =20 log_rotation_method=3Dd =20 log_archive_path=3D/usr/local/nagios/var/archives =20 use_syslog=3D1 =20 log_notifications=3D1 =20 log_service_retries=3D1 =20 log_host_retries=3D1 =20 log_event_handlers=3D1 =20 log_initial_states=3D0 =20 log_external_commands=3D1 =20 log_passive_checks=3D1 =20 service_inter_check_delay_method=3Ds =20 max_service_check_spread=3D30 =20 service_interleave_factor=3Ds =20 host_inter_check_delay_method=3Ds =20 max_host_check_spread=3D30 =20 max_concurrent_checks=3D0 =20 service_reaper_frequency=3D10 =20 auto_reschedule_checks=3D0 =20 auto_rescheduling_interval=3D30 =20 auto_rescheduling_window=3D180 =20 sleep_time=3D0.25 =20 service_check_timeout=3D60 host_check_timeout=3D30 event_handler_timeout=3D30 notification_timeout=3D30 ocsp_timeout=3D5 perfdata_timeout=3D5 =20 retain_state_information=3D1 =20 state_retention_file=3D/usr/local/nagios/var/retention.dat =20 retention_update_interval=3D60 =20 use_retained_program_state=3D1 =20 use_retained_scheduling_info=3D0 =20 interval_length=3D60 =20 use_aggressive_host_checking=3D0 =20 execute_service_checks=3D1 =20 accept_passive_service_checks=3D1 =20 execute_host_checks=3D1 =20 accept_passive_host_checks=3D1 =20 enable_notifications=3D1 =20 enable_event_handlers=3D1 =20 process_performance_data=3D0 =20 obsess_over_services=3D0 =20 check_for_orphaned_services=3D0 =20 check_service_freshness=3D1 =20 service_freshness_check_interval=3D60 =20 check_host_freshness=3D0 =20 host_freshness_check_interval=3D60 =20 aggregate_status_updates=3D1 =20 status_update_interval=3D15 =20 enable_flap_detection=3D0 =20 low_service_flap_threshold=3D5.0 high_service_flap_threshold=3D20.0 low_host_flap_threshold=3D5.0 high_host_flap_threshold=3D20.0 =20 date_format=3Dus =20 p1_file=3D/usr/local/nagios/bin/p1.pl =20 illegal_object_name_chars=3D`~!$%^&*|'"<>?,()=3D =20 illegal_macro_output_chars=3D`~$&|'"<> =20 use_regexp_matching=3D0 =20 use_true_regexp_matching=3D0 =20 admin_email=3Dnagios =20 admin_pager=3Dpagenagios =20 daemon_dumps_core=3D0 =20 # EOF (End of file) =20 =20 =20 =20 |