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