Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #7576] validate configured legacy timeperiod ranges #2194

Closed
icinga-migration opened this issue Nov 5, 2014 · 19 comments
Closed
Labels
area/configuration DSL, parser, compiler, error handling blocker Blocks a release or needs immediate attention bug Something isn't working
Milestone

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/7576

Created by JayNewman on 2014-11-05 04:15:24 00:00

Assignee: mfriedrich
Status: Resolved (closed on 2015-02-13 16:25:02 00:00)
Target Version: 2.3.0
Last Update: 2015-02-13 16:25:02 00:00 (in Redmine)

Icinga Version: v2.1.1-296-g46b149d

Problem

TimePeriod ranges are checked at runtime and generate ugly exceptions.

Solution

  • Pass the exceptions to the caller
  • Add a config validator which checks the time and range definitions inside the ranges dictionary

Original Report

/etc/init.d/icinga2 checkconfig completes without errors.
However, performing a service restart generates an issue :

../icinga/legacytimeperiod.cpp(261): Throw in function static void icinga::LegacyTimePeriod::ParseTimeSpec(const icinga::String&, tm*, tm*, tm*)
Dynamic exception type: N5boost16exception_detail10clone_implINS0_19error_info_injectorISt16invalid_argumentEEEE
std::exception::what: Invalid time specification: december
[PN6icinga10StackTraceE] = 
    (0) libbase.so: void boost::throw_exception >(boost::exception_detail::error_info_injector const&) ( 0x159) [0x6a9fa9]
    (1) libicinga.so: icinga::LegacyTimePeriod::ParseTimeSpec(icinga::String const&, tm*, tm*, tm*) ( 0x3d5) [0x1248115]
    (2) libicinga.so: icinga::LegacyTimePeriod::ParseTimeRange(icinga::String const&, tm*, tm*, int*, tm*) ( 0x2dd) [0x1248a0d]
    (3) libicinga.so: icinga::LegacyTimePeriod::IsInDayDefinition(icinga::String const&, tm*) ( 0x4d) [0x128287d]
    (4) libicinga.so: icinga::LegacyTimePeriod::ScriptFunc(boost::shared_ptr const&, double, double) ( 0x1fd) [0x1282bdd]
    (5) libicinga.so: icinga::Value icinga::ScriptFunctionWrapperR, boost::shared_ptr const&, double, double>(boost::shared_ptr (*)(boost::shared_ptr const&, double, double), std::vector > const&) ( 0x130) [0x12fccf0]
    (6) libicinga.so: boost::detail::function::function_obj_invoker1 (*)(boost::shared_ptr const&, double, double), std::vector > const&), boost::_bi::list2 (*)(boost::shared_ptr const&, double, double)>, boost::arg<1> > >, icinga::Value, std::vector > const&>::invoke(boost::detail::function::function_buffer&, std::vector > const&) ( 0x20) [0x12a40c0]
    (7) libbase.so: icinga::ScriptFunction::Invoke(std::vector > const&) ( 0x3b) [0x6417db]
    (8) libbase.so: icinga::DynamicObject::InvokeMethod(icinga::String const&, std::vector > const&) ( 0x264) [0x65b164]
    (9) libicinga.so: icinga::TimePeriod::UpdateRegion(double, double, bool) ( 0x305) [0x125ab25]
    (10) libicinga.so: icinga::TimePeriod::Start() ( 0x47) [0x125b867]
    (11) libbase.so: icinga::DynamicObject::Activate() ( 0x148) [0x64d068]
    (12) libconfig.so: boost::detail::function::void_function_obj_invoker0, boost::_bi::list1 > > >, void>::invoke(boost::detail::function::function_buffer&) ( 0x1f) [0xcc395f]
    (13) libbase.so: icinga::WorkQueue::WorkerThreadProc() ( 0x382) [0x64ba12]
    (14) libbase.so: boost::detail::thread_data, boost::_bi::list1 > > >::run() ( 0x27) [0x67ad97]
    (15) libboost_thread-mt.so.5: thread_proxy ( 0x76) [0xee4b66]
    (16) libpthread.so.0:  ( 0x6b39) [0xfe6b39]
    (17) libc.so.6: clone ( 0x5e) [0xdebd6e]


[PN6icinga12ContextTraceE] = 
    (0) Activating object 'us-holidays' of type 'TimePeriod'


***
* This would indicate a runtime problem or configuration error. If you believe this is a bug in Icinga 2
* please submit a bug report at https://dev.icinga.org/ and include this stack trace as well as any other
* information that might be useful in order to reproduce this problem.

I tried commenting out the 1 time period configuration , and the error moved on to the next configuration in the file.

Here is the part of the configuration that caused the above error:

object TimePeriod "24x7_sans_holidays" {
  import "legacy-timeperiod"
  display_name = "24x7 Sans Holidays"
  ranges = {
    "use" = "us-holidays"
    "sunday" = "00:00-24:00"
    "monday" = "00:00-24:00"
    "tuesday" = "00:00-24:00"
    "wednesday" = "00:00-24:00"
    "thursday" = "00:00-24:00"
    "friday" = "00:00-24:00"
    "saturday" = "00:00-24:00"
  }
}

Changesets

2015-02-13 16:10:58 00:00 by (unknown) 2ed78e8

Validate configured TimePeriod ranges

Requires re-throwing the hidden exceptions inside the existing
timeperiod code and validating the configured time range
strings then.

fixes #7576

Relations:

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-11-05 08:25:28 00:00

"use" in ranges is invalid. Where does that config come from?

The error is sourced from this

Activating object 'us-holidays' of type 'TimePeriod'

Please show the object configuration of that file.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-11-05 08:26:18 00:00

  • Status changed from New to Feedback
  • Assigned to set to JayNewman

@icinga-migration
Copy link
Author

Updated by JayNewman on 2014-11-05 13:05:13 00:00

Thank you, you are quite correct - the "use" statement was improperly located in the config file.
However, ideally, (as a feature rather than a bug?) we would report this during the checkconfig.

I updated the configuration , am still having problems. Have included below the entire file where I define timeperiods.

object TimePeriod   "24x7" {
import "legacy-timeperiod" 
display_name = "24 Hours A Day,7 Days A Week"
ranges = {
"saturday" = "00:00-24:00"
"friday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"monday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "24x7_sans_holidays" {
import "legacy-timeperiod" 
display_name = "24x7 Sans Holidays"
import "us-holidays"
ranges = {
"sunday" = "00:00-24:00"
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
}
}
object TimePeriod   "abrown_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for abrown"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "acormier_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for acormier"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "afeick_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for afeick"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "anogueira_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for anogueira"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "apackman_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for apackman"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "bbeals_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for bbeals"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "benm_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for benm"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "bsharpe_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for bsharpe"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "bstencell_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for bstencell"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "davidg_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for davidg"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "ebracken_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for ebracken"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "ehodder_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for ehodder"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "esilva_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for esilva"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "gcudmore_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for gcudmore"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "gkeparutis_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for gkeparutis"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "gloganathan_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for gloganathan"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "jaytest_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for jaytest"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "jcarey_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for jcarey"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "jdavidson_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for jdavidson"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "jgrant_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for jgrant"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "jmckessock_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for jmckessock"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "jmiles_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for jmiles"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "jnewman_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for jnewman"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "jthomas_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for jthomas"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "jto_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for jto"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "jwalsh_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for jwalsh"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "kfalla_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for kfalla"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "lrys_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for lrys"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "msims_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for msims"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "msleiman_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for msleiman"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "msmith_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for msmith"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "nagiosadmin_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for nagiosadmin"
ranges = {
"tuesday" = "00:00-24:00"
"monday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
"friday" = "00:00-24:00"
}
}
object TimePeriod   "none" {
import "legacy-timeperiod" 
display_name = "No Time Is A Good Time"
}
object TimePeriod   "nonworkhours" {
import "legacy-timeperiod" 
display_name = "Non-Work Hours"
ranges = {
"saturday" = "00:00-24:00"
"friday" = "00:00-09:00,17:00-24:00"
"thursday" = "00:00-09:00,17:00-24:00"
"wednesday" = "00:00-09:00,17:00-24:00"
"tuesday" = "00:00-09:00,17:00-24:00"
"monday" = "00:00-09:00,17:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "pmiskinis_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for pmiskinis"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "testuser1_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for testuser1"
ranges = {
"saturday" = "00:00-24:00"
"friday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"monday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "tlaurence_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for tlarence"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "tlegere_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for tlegere"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "twoo_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for twoo"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "us-holidays" {
import "legacy-timeperiod" 
display_name = "U.S. Holidays"
ranges = {
"january" = "1 00:00-00:00"
"monday" = "1 september 00:00-00:00"
"july" = "4 00:00-00:00"
"thursday" = "-1 november 00:00-00:00"
"december" = "25 00:00-00:00"
}
}
object TimePeriod   "workhours" {
import "legacy-timeperiod" 
display_name = "Normal Working Hours"
ranges = {
"friday" = "09:00-17:00"
"thursday" = "09:00-17:00"
"wednesday" = "09:00-17:00"
"tuesday" = "09:00-17:00"
"monday" = "09:00-17:00"
}
}
object TimePeriod   "xi_timeperiod_24x7" {
import "legacy-timeperiod" 
display_name = "24x7"
ranges = {
"name" = "xi_timeperiod_24x7"
"sunday" = "00:00-24:00"
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
}
}
object TimePeriod   "yberetta_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for yberetta"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "ykornyk_notification_times" {
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
}
}
object TimePeriod   "yberetta_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for yberetta"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}
object TimePeriod   "ykornyk_notification_times" {
import "legacy-timeperiod" 
display_name = "Notification Times for ykornyk"
ranges = {
"monday" = "00:00-24:00"
"tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00"
"friday" = "00:00-24:00"
"saturday" = "00:00-24:00"
"sunday" = "00:00-24:00"
}
}

@icinga-migration
Copy link
Author

Updated by JayNewman on 2014-11-05 14:29:31 00:00

Update :

  • I removed the reference to "us-holidays" and it still bombed in the same manner.
  • I commented out the definition for "us-holidays" and it then bombed on "xi_timeperiod_24x7"
  • I commented out the definition for "xi_timeperiod_24x7" and it started successfully.

Do I have an error in the above definitions?

and should this be planned for future development to be caught during checkconfig ?

Cheers

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-11-11 21:58:18 00:00

"name" = "xi_timeperiod_24x7" 

is, for example, an invalid range. That obviously comes from an external source as well. There is an issue open for validating timeperiod definitions properly, but as you may have figured already, that format is a pain to validate and parse. And #6070 holds the general issue for improving error messages.

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-11-11 21:58:26 00:00

  • Relates set to 6070

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-11-11 21:59:08 00:00

  • Relates set to 5323

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-11-11 22:01:09 00:00

  • Subject changed from ../icinga/legacytimeperiod.cpp(261): Throw in function static void icinga::LegacyTimePeriod::ParseTimeSpec(const icinga::String&, tm*, tm*, tm*) to icinga::LegacyTimePeriod::ParseTimeSpec exception on faulty ranges entries

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2014-11-24 12:33:14 00:00

  • Target Version set to 2.3.0

To-do:

  • Improve config validation for timeperiods.

@icinga-migration
Copy link
Author

Updated by gbeutner on 2015-01-08 12:40:56 00:00

  • Description updated

@icinga-migration
Copy link
Author

Updated by tobiasvdk on 2015-01-17 21:41:46 00:00

  • Relates set to 6723

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-01-23 10:04:08 00:00

  • Status changed from Feedback to New
  • Assigned to deleted JayNewman

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-01-26 15:05:58 00:00

  • Target Version changed from 2.3.0 to 2.4.0

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-02-09 09:29:15 00:00

  • Target Version changed from 2.4.0 to 2.3.0

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-02-09 12:19:00 00:00

  • Priority changed from Normal to High

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-02-09 12:34:03 00:00

  • Estimated Hours set to 8

@icinga-migration
Copy link
Author

Updated by gbeutner on 2015-02-13 09:53:47 00:00

  • Assigned to set to mfriedrich

@icinga-migration
Copy link
Author

Updated by mfriedrich on 2015-02-13 16:21:34 00:00

  • Subject changed from icinga::LegacyTimePeriod::ParseTimeSpec exception on faulty ranges entries to validate configured legacy timeperiod ranges

  • Description updated

  • Status changed from New to Assigned

    object TimePeriod "7576-24x7_sans_holidays" {
    import "legacy-timeperiod"
    display_name = "24x7 Sans Holidays"
    ranges = {
    "use" = "us-holidays"
    "sunday" = "00:00-24:00"
    "monday" = "00:00-24:00"
    "tuesday" = "00:00-24:00"
    "wednesday" = "00:00-24:00"
    "thursday" = "00:00-24:00"
    "friday" = "00:00-24:00"
    "saturday" = "00:00-24:00"
    }
    }

    object TimePeriod "us-holidays" {
    import "legacy-timeperiod"
    display_name = "U.S. Holidays"
    ranges = {
    "january" = "1 00:00-00:00"
    "monday" = "1 september 00:00-00:00"
    "july" = "4 00:00-00:00"
    "thursday" = "-1 november 00:00-00:00"
    "december" = "25 00:00-00:00"
    }
    }

    object TimePeriod "7576-ranges-left-broken" {
    import "legacy-timeperiod"
    display_name = "24x7 Sans Holidays"
    ranges = {
    "sunday" = "00:00-24:00 abc"
    "monday" = "foobar 00:00-24:00"
    "tuesday" = "trallala 00:00-24:00"
    "wednesday" = "00:00-24:00"
    "thursday" = "00:00-24:00"
    "friday" = "00:00-24:00"
    "saturday" = "00:00-24:00"
    }
    }

@icinga-migration
Copy link
Author

Updated by Anonymous on 2015-02-13 16:25:03 00:00

  • Status changed from Assigned to Resolved
  • Done % changed from 0 to 100

Applied in changeset 2ed78e8.

@icinga-migration icinga-migration added blocker Blocks a release or needs immediate attention bug Something isn't working area/configuration DSL, parser, compiler, error handling labels Jan 17, 2017
@icinga-migration icinga-migration added this to the 2.3.0 milestone Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/configuration DSL, parser, compiler, error handling blocker Blocks a release or needs immediate attention bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant