Undocumented timeperiod directive ('name')?


I found what seems to be an undocumented directive in the 3.0.3 default timeperiods.cfg file. In the ‘us-holidays’ definition section of this file there are 2 directives:
[blockquote] name us-holidays
timeperiod_name us-holidays
I deleted the ‘name’ directive because it seemed redundant and spurious (since it isn’t in the documentation) and got an error that would suggest that this directive is required in order to include a ‘use us-holidays’ directive in subsequent definitions.

Can someone provide an authoritative description (or a link to one) of the ‘name’ directive when used in a timeperiod definition?



It is used for a template needed for lower timeperiod definition where US holidays are an exception. It is allowed to define the object (in this case timeperiod) and use it later as a template for some other object definition. That is what name variable is used for.
Although I think in lower definition called “24x7_sans_holidays” there should stand

instead of

try with that. But, generaly, that is the answer to jour question.


Thank you. I don’t understand the reasoning behind the need for a ‘name’ directive, but at least I know that it is required and how to use it. It seems more natural (to me) to refer to previously defined timeperiods by their ‘timeperiod_name’ value.


If you’re still reading this subject, I just did a quick test, as I noticed I don’t have a ‘name’ directive in any timeperiod def (on my nagios 3.0.3).

Instead, I have the “alias” directive … And I just found out that you need have one of those (either name or alias), otherwise, you get this error:
Error: Name or alias for timeperiod is NULL
and, as you can see at:
nagios.sourceforge.net/docs/2_0/ … timeperiod
the “alias” directive is in red, which means that it is required

As a conclusion: forget about the ‘name’ directive and use the ‘alias’ directive, which is defined as:
“alias: This directive is a longer name or description used to identify the time period”