Details
-
Feature
-
Status: Released (View Workflow)
-
Major
-
Resolution: Fixed
-
None
Description
What it does
- Currently monitors are configured on a per job basis and are included with a <job><monitor> element.
- This feature allows to configure monitors for pre- and postprocessing at a global level. Monitors can be configured centrally and are automatically associated to jobs based on rules that are implemented by the plugin.
- You wouldn't have to configure the same monitor(s) for a number of jobs. Instead, based on the location of the monitor(s) in the file system and a set of rules the corresponding monitors are automatically added to the respective jobs.
How it works
- A plugin is provided that allows the use of global Named Monitors for a number of jobs as provided by the JobScheduler features
JS-1145(Provide named monitors) andJS-1322(Plugin interface for loading jobs). - The plugin is executed by JobScheduler when loading jobs.
- JobScheduler hands over the job configuration to the plugin.
- The plugin selects a number of Named Monitors based on its configuration.
- The plugin returns the job configuration to JobScheduler having added a <monitor.use> element for each applicable monitor.
Configuration
- The plugin implements configurable rules for the use of Named Monitors as stated in
JS-1145for- selection by patterns (regular expressions)
- recursive use starting from a configurable directory
<plugins> <plugin java_class="com.sos.scheduler.plugins.globalmonitor.GlobalMonitorPlugin"> <plugin.config> <jobparams> <param name="configuration_directory" value="C:/Users/ur/Documents/sos-berlin.com/jobscheduler/scheduler_current/config/live"/> <param name="exclude_dir" value="sos"/> <param name="exclude_file" value="Neuer Ordner/job1"/> <param name="recursive" value="true"/> <param name="regex_selector" value="^job.*$"/> </jobparams> <monitorparams> <param name="exclude_dir" value="sos"/> <param name="exclude_file" value="fileExclusions"/> <param name="recursive" value="true"/> <param name="regex_selector" value="^global_.*$"/> </monitorparams> </plugin.config> </plugin>
-
- ordering
- for pre-processing Named Monitors from outer folders are applied before those from inner folders
- for postprocessing Named Monitors from inner folders are applied before those from outer folders
- the ordering will be assigned by setting the ordering attribute in the use named monitor files.
- ordering
- All named monitors that comply with the configured rules are applied.
- The plugin decides whether or not the job should be changed. The plugin therefore creates a list with the jobs that are to be handled. The plugin uses the following parameters to do this
- a static directory
- recursiv yes/no
- a regular expression that defines the jobs to be handled.
- an exclusion list for jobs
- an exclusion list for directories
Ordering of monitors
- suppose the job is in the folder a/b/c
- all before_process monitors in a will be executed before monitors in b and c
- all after_process monitors in c will be executed before monitors in b and a
- for all monitors in one folder the ordering atttribute will have an effect for the monitors in the current folder.
Handling of result code
- All after monitors will be executed
- Even if one after monitore returns false
- The return value of the last after monitor sets the return value of the job
- The value of spooler_process_reusult is coming from the monitore that was executed before the current monitor.
- If one of the before monitors returns false no more monitors will be executed.
Example for recursive use with specific job directories
- Configuration sample for jobs
directory=live recursive=true regex=^job_.*\.job.xml$ exclude_dir=sos
- Behavior
- All job names that begin with job_ will be included in the list. Jobs in the directory live/sos will be excluded.
- Explanations
- If the current job is included in the list then the plugin will modify the <monitor.use> list in the job definition. The plugin makes use of the following parameters to create the list of monitors:
- use_parent_folders=true: gather all monitors from the parent folder
- a regular expression to define the set of the monitors.
- If the current job is included in the list then the plugin will modify the <monitor.use> list in the job definition. The plugin makes use of the following parameters to create the list of monitors:
Example for use with monitors from a parent folder
- Configuration sample for monitors
use_parent_folders=true regex=^global_.*\.monitor.xml$
- Behavior
- All monitor names in the directory of the current job that begin with global_ will be included in the list.
- Explanations
- The parameters are specified with the plugin configuration.
- The directory name is assumed to begin with $SCHEDULER_HOME/config/live, therefore the value sos is translated to $SCHEDULER_HOME/config/live/sos.
Complete Configuration Examples
- Use exclusively parent folders for monitors. All job names in the live folder that begin with job_ will be handled, except for jobs in the folder live/sos,
<spooler xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.sos-berlin.com/repository/scheduler/1.9/scheduler.xsd"> <config> <plugins> <plugin java_class="...ConfigurationModifierPlugin"> <plugin.config> <jobs> <param name="configuration_directory" value="live"/> <param name="regex_selector" value="^job_.*\.job.xml$"/> <param name="exclude_dir" value="sos"/> <param name="exlude_file" value="xxx"/> </jobs> <monitors> <param name="recursive" value="true"/> </monitors> </plugin.config> </plugin> </plugins> </config> </spooler>
- Use a regular expression to filter applicable monitors
<spooler xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.sos-berlin.com/repository/scheduler/1.9/scheduler.xsd"> <config> <plugins> <plugin java_class="...ConfigurationModifierPlugin"> <plugin.config> <jobs> <param name="configuration_directory" value="live"/> <param name="regex_selector" value="^job_.*\.job.xml$"/> <param name="exclude_dir" value="sos"/> </jobs> <monitors> <param name="recursive" value="true"/> <param name="regexSelector" value="^global_.*\.monitor.xml$"/> </monitors> </plugin.config> </plugin> </plugins> </config> </spooler>
- Use exclusively named monitors located in the directory of the current job
<spooler xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.sos-berlin.com/repository/scheduler/1.9/scheduler.xsd"> <config> <plugins> <plugin java_class="...ConfigurationModifierPlugin"> <plugin.config> <jobs> <param name="configuration_directory" value="."/> <param name="regex_selector" value="^job_.*\.job.xml$"/> <param name="exclude_dir" value="sos"/> </jobs> <monitors> <param name="recursive" value="false"/> </monitors> </plugin.config> </plugin> </plugins> </config> </spooler>
- Use an exclusion list (e.g. live/sos)
<spooler xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.sos-berlin.com/repository/scheduler/1.9/scheduler.xsd"> <config> <plugins> <plugin java_class="...ConfigurationModifierPlugin"> <plugin.config> <jobs> <param name="configuration_directory" value="live"/> <param name="regex_selector" value="^job_.*\.job.xml$"/> <param name="exclude_dr" value="sos"/> </jobs> <monitors> <param name="recursive" value="false"/> </monitors> </plugin.config> </plugin> </plugins> </config> </spooler>
- Use monitors recursively
<spooler xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.sos-berlin.com/repository/scheduler/1.9/scheduler.xsd"> <config> <plugins> <plugin java_class="...ConfigurationModifierPlugin"> <plugin.config> <jobs> <param name="configuration_directory" value="live"/> <param name="regex_selector" value="^job_.*\.job.xml$"/> <param name="exclude_dir" value="sos"/> <param name="recursive" value="true"/> </jobs> <monitors> <param name="recursive" value="true"/> </monitors> </plugin.config> </plugin> </plugins> </config> </spooler>
Attachments
Issue Links
- is related to
-
DOC-40 Document Enforced Monitor feature
- Resolved
-
DOC-27 Document Named Monitor feature
- Approved
- requires
-
JS-1145 Provide named monitors
- Released
-
JS-1322 Plugin interface for loading jobs
- Released
-
JS-1324 Configuration elements for global pre- and post-processing
- Released
- mentioned in
-
Page Loading...
(1 mentioned in)