Time templates are a part of the agent-based flexible management
policy syntax. They allow you to configure the agent to send
messages to different management servers based on the time and day.
A time template consists of the following:
Template name
Time conditions
Each time condition defines a specific time period. This time
period contains definitions of the time, day, date, or any
combination of the three. The local time zone is always used to
evaluate the template.
NOTE:
When specifying a time, use 24-hour clock notation. For example,
for "1:00 p.m." type 13:00.
Examples of Time Templates
The following examples show various ways to specify time formats
in the time templates:
No Time
If you do not specify a particular time, day of the week, or
year, then the condition will be true for 24 hours, from 00:00 to
24:00 every day of the year.
You have to set up a time template for the message target rules
even if the scheduled action does not depend on time. You can use
the variable $OPC_ALWAYS to configure time templates when the
condition is always true.
Specific Dates or Dates
If you specify a condition, the conditions exist continually for
the day or date specified:
Day
If you specify only Tuesday, the condition will evaluate as true
every Tuesday from 00:00 to 23:59 throughout the year, every year.
Use the syntax:
WEEKDAY ON Tuesday
Date
Specifying January 1 and nothing else will match a condition every
January 1st of every year. Use the syntax:
DATE ON 01/01/*
Time Periods
You can set time periods:
Time
To set a time period from 7:00 to 17:00, use the syntax:
TIME FROM 7:00 TO 17:00
Day
To set a time period from Monday to Friday, use the syntax:
WEEKDAY FROM Monday TO Friday
Date
To set a time period from the year 1995 to 2000, use the
syntax:
DATE FROM 01/01/1995 TO 12/31/1999
Date and Time
To set a time on December 31 1998, from 23:00 to 23:59, use the
syntax:
TIME FROM 23:00 TO 23:59 DATE ON 12/31/1998
If you include the day of the week (for example, Monday April 1,
1997), the day and date will be cross-checked to make sure that
they match the calendar.
Wildcards (*)
You can set dates or periods using a wildcard character (*):
Specific Dates
To set a condition for December 1st every year, use the syntax:
DATE ON 12/01/*
Time Periods
To set a condition from August 6th to September 10th every year,
use the syntax:
DATE FROM 08/06/* TO 09/10/*
Keywords for Time Templates
To define the various elements required in an agent-based
flexible management configuration, the following keywords and
definitions are used:
TIMETEMPLATE <string>
Template name is contained in <string>.
DESCRIPTION
Short description of the time template.
TIMETMPLCONDS
TIMETMPLCOND
TIMECONDTYPE
Condition defining a single time interval. Several time conditions
together make up a time period. A time condition allows you to use
combinations of day, date, and time to define a time period.
At least one of the following parts must be used for the
definition:
Match
Suppress
If the current time is within the defined time period, match is
true and suppress is false.
TIME FROM <time> TO <time>
Specifies a time period. Set the variable <time> using the
format:
<HH>:<MM>
The FROM <time> variable must be before the TO <time>
variable (for example, FROM 18:00 TO 24:00 or FROM 0:00 TO
6:00).
WEEKDAY
You can specify every day of the week: Monday, Tuesday, Wednesday,
Thursday, Friday, Saturday, or Sunday:
ON <day>
Day of the week (for example, ON Sunday).
FROM <day> TO <day>
Time period (for example, FROM Monday TO Wednesday).
DATE
Date must have one of the following formats:
<MM>/<DD>/<YYYY>
<MM>/<DD>/<YY>
<MM>/<DD>/*
Invalid time periods are not recognized. For example, 10/35/* is
not recognized as an invalid date.
You specify the date as follows:
ON <date>
FROM <date>
TO <date>