Page 1 of 1
Time periods
Posted: Wed Dec 04, 2019 11:32 am
by MOHANREDDY
Hi,
i have 2 services checking the same folder with different time periods, 1 time period from 6:00 AM to 18:00 PM and other from 18:00 PM to next day 6 AM.
I have configured them as below.
define timeperiod {
timeperiod_name Non Production hours
alias Non Production hours
friday 18:00-24:00
saturday 00:00-24:00
sunday 00:00-24:00
monday 00:00-06:00
monday 18:00-06:00
tuesday 18:00-06:00
wednesday 18:00-06:00
thursday 18:00-06:00
}
define timeperiod {
timeperiod_name Production hours
alias Production hours
monday 06:00-18:00
tuesday 06:00-18:00
wednesday 06:00-18:00
thursday 06:00-18:00
friday 06:00-18:00
}
Is my non production hours time period setting correct?
as i am not receiving alerts with that time period.
Re: Time periods
Posted: Wed Dec 04, 2019 11:37 am
by scottwilkerson
MOHANREDDY wrote:
Is my non production hours time period setting correct?
No, timeperiods cannot wrap past midnight
You would need to adjust to something like the following
Code: Select all
define timeperiod {
timeperiod_name Non Production hours
alias Non Production hours
saturday 00:00-24:00
sunday 00:00-24:00
monday 00:00-06:00,18:00-24:00
tuesday 00:00-06:00,18:00-24:00
wednesday 00:00-06:00,18:00-24:00
thursday 00:00-06:00,18:00-24:00
friday 00:00-06:00,18:00-24:00
}
Re: Time periods
Posted: Wed Dec 04, 2019 11:39 am
by MOHANREDDY
If i use above time periods i mentioned, wont i get an alert as nagios caught alert but didn't fire that alert
Re: Time periods
Posted: Wed Dec 04, 2019 11:48 am
by scottwilkerson
MOHANREDDY wrote:If i use above time periods i mentioned, wont i get an alert as nagios caught alert but didn't fire that alert
I don't understand the question, could you clarify what you are referring to?
Re: Time periods
Posted: Wed Dec 04, 2019 12:03 pm
by MOHANREDDY
For a service i used this time period
define timeperiod {
timeperiod_name Non Production hours
alias Non Production hours
friday 18:00-24:00
saturday 00:00-24:00
sunday 00:00-24:00
monday 00:00-06:00
monday 18:00-06:00
tuesday 18:00-06:00
wednesday 18:00-06:00
thursday 18:00-06:00
}
I didn't receive an alert but when i check state history report critical alert was reported at 21:24.
so my question is, does nagios alerts customers irrespective of wrong time periods?
Re: Time periods
Posted: Wed Dec 04, 2019 12:08 pm
by scottwilkerson
MOHANREDDY wrote:For a service i used this time period
define timeperiod {
timeperiod_name Non Production hours
alias Non Production hours
friday 18:00-24:00
saturday 00:00-24:00
sunday 00:00-24:00
monday 00:00-06:00
monday 18:00-06:00
tuesday 18:00-06:00
wednesday 18:00-06:00
thursday 18:00-06:00
}
I didn't receive an alert but when i check state history report critical alert was reported at 21:24.
so my question is, does nagios alerts customers irrespective of wrong time periods?
I mentioned before that you cannot have timeperiods that span across the midnight boundary, as such 18:00-06:00 isn't valid.
Additionally, there is the check timeperiod, and the notification timeperiod
Which of these are you using this timeperiod for?
I suspect that entering something like 18:00-06:00 would end up being interpreted as 18:00-24:00 but I am not 100% sure as it is know to be invalid
Re: Time periods
Posted: Wed Dec 04, 2019 12:34 pm
by MOHANREDDY
I had used 18:00 - 06:00 as notification time period, even if it interprets 18:00 - 06:00 as 18:00-24:00 i didn't get any around 21:24 which is in 18:00-24:00 time period.
Re: Time periods
Posted: Wed Dec 04, 2019 12:36 pm
by scottwilkerson
As I stated,
scottwilkerson wrote:I am not 100% sure as it is know to be invalid
I would suggest replacing the timeperiod with my suggestions.