guides:reference:system_events:jobs
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| guides:reference:system_events:jobs [2023/11/01 12:47] – [Set-up] pgels | guides:reference:system_events:jobs [2024/07/03 12:31] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ===== Scheduling jobs through events ===== | ||
| + | Starting from version 8.2.2 there will be the option available to trigger a job after a syslog event.There are a few settings you need to take into account, but after setting it up it should work automatically. | ||
| + | |||
| + | ==== Set-up ==== | ||
| + | |||
| + | First of all we need to add the following triggers to etc/ | ||
| + | |||
| + | < | ||
| + | # | ||
| + | type=SingleWithSub | ||
| + | ptype=RegExp | ||
| + | pattern=syslog_received_for_(\S+) | ||
| + | sub=create_job | ||
| + | arg=$1 | ||
| + | desc=$0 | ||
| + | action=write - normal save OR save main node $1 matches. | ||
| + | # | ||
| + | </ | ||
| + | |||
| + | The key is the sub=create_job: | ||
| + | |||
| + | This triggers a job that contains a task with scenario " | ||
| + | |||
| + | To trigger the job, you need a user. The name of this user is ' | ||
| + | |||
| + | As soon as you have updated your yce_events.netyce.conf and set the permissions for the xch user, this should work. | ||
| + | |||
| + | ==== Using interfaces as a second argument ==== | ||
| + | |||
| + | If you want to send along a second argument, the way to do it is as follows: | ||
| + | |||
| + | # | ||
| + | type=SingleWithSub | ||
| + | ptype=RegExp | ||
| + | pattern=syslog_received_for_(\S+)_(\S+) | ||
| + | sub=create_job | ||
| + | arg=$1 | ||
| + | arg2=$2 | ||
| + | desc=$0 | ||
| + | action=write - normal save OR save main node $1 matches. | ||
| + | # | ||
| + | |||
| + | Arg1 contains the hostname, Arg2 contains the interface name. This will end up in the job as a parameter called " | ||