En manual » History » Version 2

walid, 08/24/2009 06:58 PM

1 1 walid
h1. The Mass_ocs_import plugin
2 1 walid
3 1 walid
This extension works from version 0.70 of GLPI or greater. Its purpose is to allow the addition and synchronization machines for OCS Inventory.
4 1 walid
5 1 walid
The extension is composed of:
6 1 walid
7 1 walid
* a script for Linux that allows to run the script from the command line or via cron. It gives the ability to run several processes to complete the treatment.
8 1 walid
* a script for Windows to run from the command line or put in a scheduled task. On this platform, the script can not run a single process for treatment.
9 1 walid
* a graphical interface that allows the execution of all scripts. It provides information on imported machines, synchronized, linked and not imported.
10 1 walid
11 1 walid
h1. Installation
12 1 walid
13 1 walid
* On Linux, the package "php-cli or php5-cli" must be installed
14 1 walid
* Copy the files in the plugins directory of GLPI.
15 1 walid
* Changing the owner of all files and directories to the apache user
16 1 walid
* Make executable scripts in the scripts directory
17 1 walid
* Log into GLPI
18 1 walid
* In the Setup menu "Plugins click Import mass OCS
19 1 walid
* Click Install the plugin
20 1 walid
* Configuration Mode OCSNG "OCS Server '" Number of items to synchronize via cron to "0"
21 1 walid
22 1 walid
h2. Configuring the plugin
23 1 walid
24 1 walid
The extension has several configuration options:
25 1 walid
26 1 walid
* OCS server by default shows the OCS server on which the script will synchronize.
27 1 walid
* Show processes where nothing has been changed: yes even if the process did not change are displayed in the list.
28 1 walid
* Clear process after xx hours: indicates the number of hours during which data from a script are stored in base. (default 24)
29 1 walid
* Number of seconds to refresh the page (not refreshrate 0): indicates the frequency in seconds to refresh the detail page of a script is refreshed. If the value is 0, the page is not redisplayed.
30 1 walid
31 1 walid
You can manually disable synchronization by clicking the button "Enable lock. In this case, a file lock is placed on the file system. This prevents the script to start synchronization. This option allows you to temporarily stop the synchronization process for a SCO Update GLPI for example.
32 1 walid
33 1 walid
h2. Use
34 1 walid
35 1 walid
The synchronization script adapted to the platform, is launched by hand and / or via a scheduled task or a crontab
36 1 walid
37 1 walid
Scripts are available in the GLPI/scripts directory.
38 1 walid
* On ** Linux ** the script is run with one of the commands:
39 1 walid
40 1 walid
@sh ocsng_fullsync.sh - thread_nbr = [number of threads to run] - server_id = [ID server OCS]@
41 1 walid
or:
42 1 walid
43 1 walid
@php run.php - thread_nbr = [number of threads to run] - server_id = [ID server OCS]@
44 1 walid
45 1 walid
46 1 walid
* Under ** Windows ** the script is run with the command
47 1 walid
@php run.php - thread_nbr = [number of threads to run] - server_id = [ID server OCS]@
48 1 walid
49 1 walid
If the command ** php ** is not in a folder in your PATH, edit and use the run.bat file''informing''the correct paths:
50 1 walid
51 1 walid
@SET path_php = 'C: OCSNGxamppphp'
52 1 walid
53 1 walid
SET plugin_glpi = 'C: OCSNGxampphtdocsglpipluginsmass_ocs_importscripts'@
54 1 walid
55 1 walid
It is possible to track the execution of scripts.
56 1 walid
The interface is accessible from the menu Plugins>> Import mass OCS.
57 1 walid
58 1 walid
h1. Launch via cron
59 1 walid
60 1 walid
Add the script in the crontab of your apache user (www-data for debian):
61 1 walid
62 1 walid
@* / 5 * * * * / var / www / glpi / plugins / mass_ocs_import / scripts / ocsng_fullsync.sh - thread_nbr = 2 - server_id = 1@
63 1 walid
64 1 walid
for example, to run the script every 5 minutes
65 1 walid
66 1 walid
For Debian / Ubuntu, if the cron job above does not work, try:
67 1 walid
@* / 5 * * * * php / var / www / glpi / plugins / mass_ocs_import / scripts / run.php - thread_nbr = 2 - server_id = 1@
68 1 walid
69 1 walid
h1. Interface tracking script executions
70 1 walid
71 1 walid
The first tab shows a list of all the scripts launched. For each of them, a summary of actions is presented. By clicking on the login script opens a 3rd tab that displays the details of all transactions, thread by thread.
72 1 walid
Visualization interface machines not imported
73 1 walid
74 1 walid
The second tab displays the list of machines that have been imported from OCS. Some information from the OCS inventory are displayed to help identify problems. For machines in this tab, you can perform a manual import. It suffices for this, select the computers and the destination entity. Then press "Import" and import occurs.
75 2 walid
76 2 walid
If the 'uninstall' plugin is installed, you get a new option to delete computers not imported directly into OCS database.