| 1 | UMIT Scheduler |
|---|
| 2 | ============== |
|---|
| 3 | |
|---|
| 4 | .. sectionauthor:: Guilherme Polo <ggpolo@gmail.com> |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | Introduction |
|---|
| 8 | ------------ |
|---|
| 9 | |
|---|
| 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. |
|---|
| 16 | |
|---|
| 17 | |
|---|
| 18 | Setting up a Schedule |
|---|
| 19 | --------------------- |
|---|
| 20 | |
|---|
| 21 | It should be very straightforward to set up a new scan schedule. |
|---|
| 22 | A 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 | |
|---|
| 83 | After filling all the required fields, you may click on "Apply". |
|---|
| 84 | If no error dialog appears, your new Scan Schedule was created sucessfully. |
|---|
| 85 | Clicking on "OK" will do the same, but will close "Scan Scheduler Editor" |
|---|
| 86 | afterwards. Clicking on "Close" will discard the schema you were |
|---|
| 87 | creating and will close the window. |
|---|
| 88 | |
|---|
| 89 | |
|---|
| 90 | Creating a new Scheduling Profile |
|---|
| 91 | --------------------------------- |
|---|
| 92 | |
|---|
| 93 | To create a new scheduling profile you need to set an unique name for |
|---|
| 94 | it, and a cron time format. UMIT comes with some scheduling profiles |
|---|
| 95 | for those that aren't familiar with cron. |
|---|
| 96 | |
|---|
| 97 | After filling all the required fields, you may click on "Apply". |
|---|
| 98 | If no error dialog appears, your new Scheduling Profile was created |
|---|
| 99 | sucessfully. Clicking on "OK" will do the same, but will close |
|---|
| 100 | "Scheduling Profiles Editor" afterwards. Clicking on "Close" will discard |
|---|
| 101 | the 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 | |
|---|
| 109 | Starting Scheduler |
|---|
| 110 | ------------------ |
|---|
| 111 | |
|---|
| 112 | When you see a "red ball" in UMIT interface, it means the Scheduler |
|---|
| 113 | is stopped. Clicking on it will start the Scheduler, or will display a Warning |
|---|
| 114 | telling some advice, or an error message. |
|---|
| 115 | |
|---|
| 116 | |
|---|
| 117 | Starting Scheduler as root |
|---|
| 118 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
|---|
| 119 | |
|---|
| 120 | To start the Scheduler as root you have some options, some will be described |
|---|
| 121 | here. First option, and not the best, would be running UMIT as root, so when |
|---|
| 122 | you 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 | |
|---|
| 126 | The second option is "harder" to do, but better. You need to open a |
|---|
| 127 | terminal, and use sudo or any other tool that can preserve environment. The |
|---|
| 128 | command will be like this:: |
|---|
| 129 | |
|---|
| 130 | sudo umit_scheduler.py start |
|---|
| 131 | |
|---|
| 132 | And the Scheduler will start. |
|---|
| 133 | |
|---|
| 134 | To stop it later, you may do:: |
|---|
| 135 | |
|---|
| 136 | sudo umit_scheduler.py stop |
|---|
| 137 | |
|---|
| 138 | umit_scheduler.py is installed in the same directory as umit, so |
|---|
| 139 | it 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 | |
|---|
| 147 | If you want to start the Scheduler with root and tell it to use someone |
|---|
| 148 | else 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 | |
|---|
| 154 | If you want to start Scheduler at system startup, you will have to write that |
|---|
| 155 | path you especified (/home/john/.umit) inside umit_scheduler.py in a var |
|---|
| 156 | called CONFIG_DIR. |
|---|
| 157 | |
|---|
| 158 | |
|---|
| 159 | Stopping Scheduler |
|---|
| 160 | ------------------ |
|---|
| 161 | |
|---|
| 162 | When you see a "green ball" in UMIT interface, it means the Scheduler |
|---|
| 163 | is running. Clicking on it will stop Scheduler, except in the case you do not |
|---|
| 164 | have permission to stop it, then a Warning will be shown. If you are on |
|---|
| 165 | Windows, the possible cause for not being able to stop the Scheduler is |
|---|
| 166 | because you did not run UMIT as administrator. |
|---|