root/branch/sphinxdoc/src/scheduler.rst @ 4308

Revision 4308, 7.7 kB (checked in by gpolo, 4 years ago)

Minor adjust.

Line 
1UMIT Scheduler
2==============
3
4.. sectionauthor:: Guilherme Polo <ggpolo@gmail.com>
5
6
7Introduction
8------------
9
10The *Scan Scheduler Editor* is the place where you will schedule
11scans to run on background without noticing. You may save the scan
12output to a file or send it to one or more emails. It is possible to
13enable and disable the schedule, it can also be configured to auto-add
14scan results to the Network Inventory by toggling the *Add to the Inventory*
15option.
16
17
18Setting up a Schedule
19---------------------
20
21It should be very straightforward to set up a new scan schedule.
22A table follows that explains everything you may see on the
23*Scan Scheduler Editor* window.
24
25.. table::  Fields explanation
26
27   +--------------------+---------------------------------------------------+
28   | Field              | Meaning                                           |
29   +====================+===================================================+
30   | Schema name        | Defines an unique name for the Scan Schedule that |
31   |                    | is being created, you may name it like            |
32   |                    | "network scan", "local scan", etc.                |
33   |                    | Note that if you choose to add this schedule      |
34   |                    | to the Inventory, the Inventory's name will be    |
35   |                    | the Schema name.                                  |
36   +--------------------+---------------------------------------------------+
37   | Scan Profile       | These profiles are the profiles you created in    |
38   |                    | UMIT, they define scan options.                   |
39   +--------------------+---------------------------------------------------+
40   | Command            | Command is the scan command that will be used in  |
41   |                    | this schedule.                                    |
42   +--------------------+---------------------------------------------------+
43   | Scheduling Profile | You need to choose one of the available           |
44   |                    | Scheduling Profiles.                              |
45   |                    | This defines when the schema command will be      |
46   |                    | executed. Clicking on "Edit Profiles" will open   |
47   |                    | the Scheduling Profiles Editor.                   |
48   +--------------------+---------------------------------------------------+
49
50.. table:: Schema Settings
51
52   +----------------------+-------------------------------------------------+
53   | Option               | Meaning                                         |
54   +======================+=================================================+
55   | Save outputs to      | If you choose to save output, you will need to  |
56   |                      | specify an output directory. A directory is     |
57   |                      | required because a schedule is likely to be     |
58   |                      | executed several times, so the file output is a |
59   |                      | combination of directory output, schema name    |
60   |                      | and number of outputs for that schema.          |
61   +----------------------+-------------------------------------------------+
62   | Send output to email | If you choose to send output to a email, you    |
63   |                      | will need to specify one or more recipients.    |
64   |                      | Example: me@example.com or                      |
65   |                      | me@example.com,her@example.com.                 |
66   |                      | You also need to choose one of the available    |
67   |                      | SMTP Schemas, if there is no SMTP Schema        |
68   |                      | created yet you will need to open "SMTP Setup"  |
69   |                      | window and create one so you can use it here.   |
70   +----------------------+-------------------------------------------------+
71   | Add to the Inventory | If you toggle on this option, the scan output   |
72   |                      | will be added to the Network Inventory,         |
73   |                      | according to the previous explanation given on  |
74   |                      | "Schema Name".                                  |
75   +----------------------+-------------------------------------------------+
76   | Enabled              | If you toggle on "Enabled", this schema will    |
77   |                      | run on the scheduled time if the Scheduler is   |
78   |                      | running. Otherwise, it will just exist but will |
79   |                      | never be executed (you may come back later and  |
80   |                      | Enable it).                                     |
81   +----------------------+-------------------------------------------------+
82
83After filling all the required fields, you may click on "Apply".
84If no error dialog appears, your new Scan Schedule was created sucessfully.
85Clicking on "OK" will do the same, but will close "Scan Scheduler Editor"
86afterwards. Clicking on "Close" will discard the schema you were
87creating and will close the window.
88
89
90Creating a new Scheduling Profile
91---------------------------------
92
93To create a new scheduling profile you need to set an unique name for
94it, and a cron time format. UMIT comes with some scheduling profiles
95for those that aren't familiar with cron.
96
97After filling all the required fields, you may click on "Apply".
98If no error dialog appears, your new Scheduling Profile was created
99sucessfully. Clicking on "OK" will do the same, but will close
100"Scheduling Profiles Editor" afterwards. Clicking on "Close" will discard
101the profile you were creating and will close the window.
102
103.. seealso::
104
105   `Crontab, some more info
106   <http://www.opengroup.org/onlinepubs/009695399/utilities/crontab.html>`_
107
108
109Starting Scheduler
110------------------
111
112When you see a "red ball" in UMIT interface, it means the Scheduler
113is stopped. Clicking on it will start the Scheduler, or will display a Warning
114telling some advice, or an error message.
115
116
117Starting Scheduler as root
118^^^^^^^^^^^^^^^^^^^^^^^^^^
119
120To start the Scheduler as root you have some options, some will be described
121here. First option, and not the best, would be running UMIT as root, so when
122you start the Scheduler it will be started as root.
123
124**If you run umit as root, it will use root's config files!** [*]_
125
126The second option is "harder" to do, but better. You need to open a
127terminal, and use sudo or any other tool that can preserve environment. The
128command will be like this::
129
130   sudo umit_scheduler.py start
131
132And the Scheduler will start.
133
134To stop it later, you may do::
135
136   sudo umit_scheduler.py stop
137
138umit_scheduler.py is installed in the same directory as umit, so
139it should be on your path already.
140
141.. [*] UMIT keeps config files for each user that runs it. If you always use
142       it as a user called 'john', for example, your config files will be
143       inside, for example, /home/john/.umit. So, when you run it as root, it
144       uses /root/.umit, and 'john' doesn't see the changes in root
145       files, neither root sees changes in john's files (usually).
146
147If you want to start the Scheduler with root and tell it to use someone
148else UMIT config files, you may do so. The final command will be like this::
149
150   umit_scheduler.py start /home/john/.umit
151
152   umit_scheduler.py stop /home/john/.umit
153
154If you want to start Scheduler at system startup, you will have to write that
155path you especified (/home/john/.umit) inside umit_scheduler.py in a var
156called CONFIG_DIR.
157
158
159Stopping Scheduler
160------------------
161
162When you see a "green ball" in UMIT interface, it means the Scheduler
163is running. Clicking on it will stop Scheduler, except in the case you do not
164have permission to stop it, then a Warning will be shown. If you are on
165Windows, the possible cause for not being able to stop the Scheduler is
166because you did not run UMIT as administrator.
Note: See TracBrowser for help on using the browser.