Page 1 of 2
Check/Notifications period
Posted: Tue Mar 19, 2013 7:15 am
by pep
I have configured a specific check/notification period for certain hosts (04:00-24:00 everyday) and nagios is sending notifications between 00:00 and 04:00 (services are down due to backup).
I have advanced services directly linked to the host, i've also tried linking advanced services through hostgroups. But i received tons of emails.
Is this some kind of bug?
Re: Check/Notifications period
Posted: Tue Mar 19, 2013 9:17 am
by slansing
Can you attach us the following configuration files?
Code: Select all
/usr/local/nagios/etc/timeperiods.cfg
And your service's configuration file?
You may block out any information you wish not to share such as real names, passwords, or IP's.
Re: Check/Notifications period
Posted: Wed Mar 20, 2013 4:48 am
by pep
I just define these periods on the host, services are monitored 24x7.
Do i have to configure these timeperiods on the service too?
I thought that service periods were inherited by host periods.
Re: Check/Notifications period
Posted: Wed Mar 20, 2013 9:33 am
by gshergill
Hi pep,
I thought that service periods were inherited by host periods.
This depends on whether or not you have defined a check_period in your service configuration (template or otherwise). However, if I'm not mistaken, a service's check_period should be ignored if the host is down, as service notifications will no longer be sent out.
But i received tons of emails.
Are these emails about services or hosts being down? i.e. are you still receiving emails about services being down if the host is? Or are these emails just saying that the host is down between the times 00.00 and 04.00?
If it's the latter, as slansing requested, could you post your timeperiods.cfg and the related host configuration file?
Thank you,
Kind regards,
Gary Shergill
Re: Check/Notifications period
Posted: Wed Mar 20, 2013 11:09 am
by pep
I've made some changes let me wait and check what happens tonight.
Thanks for your help =)
Re: Check/Notifications period
Posted: Wed Mar 20, 2013 11:55 am
by slansing
If you get a chance, let us know how your notifications are looking tonight!
Re: Check/Notifications period
Posted: Thu Mar 21, 2013 4:27 am
by pep
I still got notification emails for services that are down while backup is running:
Timeperiods definition:
define timeperiod {
timeperiod_name machine
alias machine
sunday 04:00-24:00
monday 04:00-24:00
tuesday 04:00-24:00
wednesday 04:00-24:00
thursday 04:00-24:00
friday 04:00-24:00
saturday 04:00-24:00
}
Host definition:
define host {
host_name machine.domain.com
address machine.domain.com
max_check_attempts 4
check_interval 5
notification_interval 0
_SYSTEMID ppp
icon_image_alt Windows
icon_image base/win40.gif
statusmap_image base/win40.gd2
check_command check-host-alive
check_period 24x7
notification_period machine
use group1,group2
contact_groups +admins}
Advanced Service example:
define service {
service_description SAP - Oracle TS SYSAUX
check_command check_sap!tssysaux$_HOSTSYSTEMID$!bbb
check_period 24x7
notification_period 24x7
host_name machine.domain.com
use group1
contact_groups +admins
}
Is there anything wrong? What if i have 20 machines with 30 advanced services each and downtime hours? I'd have to configure it 600 times???
Re: Check/Notifications period
Posted: Thu Mar 21, 2013 10:30 am
by slansing
Is there anything wrong? What if i have 20 machines with 30 advanced services each and downtime hours? I'd have to configure it 600 times???
This is the reason you can configure templates, or host/service groups. Templates are used to make blanket changes over your hosts or services in groups. Where Host/Service groups allow you to push changes to all the configurations within.
Back to the original issue, you need to define a notification period for the services as well. In addition, this is a good use for Scheduled Downtime, you can access this page through the following Menu link:
Home Page > System Section > Downtime.
You can set the downtime for hosts and services in this section, which effectively "turns them off" during the period you designate. Unfortunately Recurring Downtime scheduling is something reserved for, and built into Nagios XI, though I believe some admins have implemented it on their Core systems.
Re: Check/Notifications period
Posted: Thu Mar 21, 2013 11:01 am
by pep
That makes me wonder...
I have all my services configured as advanced services, this way i don't have to create one service per host, only one advanced service works for each host.
These services notify only one person from department A through a service template.
Now i want to add some more hosts for people from department B, what would happen if i reuse those previously created advanced services and add another service template for departmentB???? Who would receive these notifications? Both departments?
Re: Check/Notifications period
Posted: Thu Mar 21, 2013 11:06 am
by abrist
pep wrote:Who would receive these notifications? Both departments?
Yes. As the service has 2 templates for notifications, one for dept. A and 1 for dept. B. You may want to move notifications to a contact template instead of a service/host template.