OCS Inventory/fr

From SME Server
Revision as of 21:33, 8 May 2021 by Gieres (talk | contribs)
Jump to navigationJump to search


Maintaineur

Stéphane de Labrusse AKA Stephdl

Version

Contrib 9:
smeserver-ocsinventory
The latest version of smeserver-ocsinventory is available in the SME repository, click on the version number(s) for more information.


Tutoriel

Installation

SME9

Vous devez d'abord activer le dépôt Remi-ocsinventory, puis :

yum install smeserver-ocsinventory --enablerepo=remi-ocsinventory,smecontribs
signal-event ocs-update

ou si vous préferrez redémarrer le serveur, faire ensuite :

signal-event post-upgrade; signal-event reboot

Après cela, vous pouvez procéder à l'installation normale selon OCS Inventory#Importing ocsagent.exe in MySQL qui devrait vous amener à http://VotreDomaine/ocs/install.php.

Répondre seulement aux questions, les informations de la base de données (BDD) mysql seront déjà là, vous n'avez pas à les modifier car elles ont été définies.

Puis faire l'installtion normale et à la suite aller sur http://VotreDomaine/ocs/index.php.

Ne pas oublier de changer les identifiant et mot de passe par défaut qui sont admin/admin.

N'oubliez pas non plus de faire :

rm -f  /usr/share/ocsinventory-reports/ocsreports/install.php

SME8

yum install smeserver-ocsinventory --enablerepo=smedev,smetest,smecontribs

then

signal-event ocs-update
signal-event post-upgrade; signal-event reboot


Warning.png Warning:
You must issue first the ocs-update before post-upgrade and reboot


Commandes spéciales

Pour voir la configuration d'OCS, vous pouvez saisir :

config show ocs

Vous pouvez changer quelques paramètres :

   Paramètre DB   |    Options   | Par défaut | Explication
# MaxUpload       | xM           | 100M       | Taille maximale de fichier téléchargé
# InventoryAccess | local/global | global     | Accessibilité du serveur OCS (pour recevoir les inventaires) 
# InventoryDelay  | >1           | 600        | Durée d'attente (sec) pour éviter la surcharge du serveur (Agent cron)
# URL             | new alias    |            | Alias facultatifs pour les interfaces Web ocs et glpi

Installation du client

Le côté client est disponible pour toutes les plateformes. Télécharger la dernière version de client en fonction de votre système d'exploitation (SE).

Après l'installation de l'Agent, vous devez le lancer manuellement pour télécharger votre premier inventaire (car il est mis à jour une fois par jour par défaut).

Pendant que vous installez l'agent, copier le fichier cacert.pem, voir la section SSL ci-dessous.

Agent OCS pour Serveur KOOZALI SME

Si vous voulez inventorier d'autres serveurs KOOZALI SME (sans installer la partie serveur et les interfaces web) :

for sme9

yum install ocsinventory-agent ocsinventory-ipdiscover --enablerepo=remi-ocsinventory

Puis éditer /etc/ocsinventory-agent/ocsinv.conf et modifier les lignes suivantes :

OCSSERVER=MonDomaine.com
OCSTAG=mon_tag

Et à la fin, lancer le premier inventaire manuellement :

ocsinventory-agent -s MonDomain.com -t mon_tag

for sme8

yum install ocsinventory-agent ocsinventory-ipdiscover --enablerepo=smetest,epel
Warning.png Warning:
this will issue a warning, which can be ignored, about : rpmts_HdrFromFdno: Entête V3 DSA signature: NOKEY, key ID 00f97f56

Public key for ocsinventory-ipdiscover-1.01-2.el5.remi.i386.rpm is not installed


Agent OCS pour Windows

Il y a 2 façons différentes d'envoyer des inventaires sur Windows. Télécharger le dernier logiciel client, OCSNG_WIN32_AGENT_1.xx_repack.zip sur le site d'OCS. Cette archive contient 3 exécutables.

Voir la Section 4.1 du fichier d'aide interne d'OCS.

Utilisation du service

Utiliser OCS comme un service est probablement ce que vous ferez.

Lancer l'installation de OcsAgentSetup.exe et fournir les paramètres par défaut du service. OCS-winagent-setup.png


Puis lancer le premier inventaire en saisissant ce qui suit dans la 'execute box':

"C:\Program Files\OCS Inventory Agent\OCSInventory.exe" /server:MonDomaine.com /np /debug /tag:mon_tag

Attendre quelques secondes et aller sur http://mon-serveur/ocs, vous devriez voir votre inventaire d'ordinateurs.

Par défaut, l'Agent contactera le Serveur une fois par jour.

Vous pouvez écraser ce comportement par défaut dans les options de l'interface web d'OCS. Vos modifications seront appliquées au contact suivant du Serveur par l'Agent.


Pour le dépannage, regarder le fichier log dans C:\Program Files\OCS Inventory Agent\COMPUTER_NAME.log.


Utilisation autonome

Vous pouvez aussi faire des inventaires sur Windows sans installer le service.

Le client autonome OCS est séparé en 2 exécutables :

  • ocsagent.exe - Ce fichier contient tous les fichiers nécessaire pour le lanceur ;
  • OcsLogon.exe - Ce fichier est l'exécutable autonome (le lanceur).

Naturellement, ocsagent.exe doit être décompressé avant le lancement de l'exécutable autonome.

Ceci peut être fait en exécutant directement ocsagent.exe: les fichiers seront décompressés dans c:\ocs-ng.

Vous pouvez également importer ce fichier dans la base de données MySQL d'OCS de façon que l'exécutable autonome puisse le télécharger au besoin. Ceci est documenté dans la section Importation MySQL.

La ligne de commande est la même que pour le service :

"C:\chemin_vers_le_fichier\OcsLogon.exe" /server:MonDomaine.com /np /debug /tag:mon_tag

Pour des inventaires plus faciles et plus rapides, vous pouvez aussi renommer cet exécutable autonome au nom de votre domaine (ne pas oublier .exe) :

"C:\chemin_vers_le_fichier\MonDomaine.com.exe" /np /debug /tag:mon_tag

Pour le dépannage, regarder le fichier log dans C:\ocs-ng\COMPUTER_NAME.log


Importer ocsagent.exe dans MySQL

Le principal avantage de cette méthode est que vous pouvez envoyer l'exécutable autonome par Internet très rapidement ou même mettre l'exécutable autonome sur une disquette comme il ne fait que 65 KB ! Comme votre vieux lecteur de disquette paraît puissant maintenant ?

Ceci permet aussi de mettre à jour les fichiers archivés dans ocsagent.exe sur vos clients (qu'ils soient service ou executable autonome).

Un empaqueteur est disponible sur le site internet d'OCS. Ceci vous permettra de repaqueter ocsagent.exe avec vos propres modifications (par exemple un certificat SSL !) OCS-packager.png


1st thing you need is to copy ocsagent.exe (modified or not) in /usr/share/ocsinventory-reports/ocsreports/files/.


Then, you can import this file in the database. Go to http://yourdomain.com/ocs/install.php

Use the pre-configured account 'ocs' for that: OCS-installphp.png


If you get a warning message (cannot alter database), refresh the page and you should see a successful import. OCS-installphp-ocsagent.png


ocsagent.exe is now in the database!

Warning.png Warning:
install.php has reset ocs password to 'ocs'. Re-apply your changes with following command:
signal-event domain-modify

This will also reset chmod to 440 on dbconfig.inc.php


You can now use OcsLogon.exe alone, it will download/update ocsagent.exe if needed!

If you want to remove ocsagent.exe from your database, simply delete the file from the server and redo install.php. This will delete the file from the database.

OCS Agent for Linux

Download the generic linux tar.gz, unpack, read the README, and as root, run the setup script.

You may required additional perl- packages, use you package management tools to search for the missing dependencies based on the README or the error messages. See Section 4.2 in the internal OCS help file.

To run an inventory

ocsinventory-client.pl -server=server.net -tag=network3

Check the time (will the PC be on) and command given in

/etc/cron.d/ocsinventory-client

OCS Inventory NG Usage

Full documentation can be found in the ocs help file, the help icon in ocs interface.

Access

OCS Reports' web interface can be reached at http://your-server/ocs

Before login, please choose your language (flags on the top right corner) OCS login page.png
Login : admin
Password: admin


Warning.png Warning:
For security-reasons, change admin's password after your first login, top right icon next to logout!


Inventories can be done from WAN but the web interface is only available from inside your network for security reasons by default. See Sections 5 & 6 in the internal OCS help file for Reporting and Administration help.

IP discovery

IP discovery feature allow OCS Inventory NG to discover all network connected devices on the network. For this, Communication server asks a number of most “active” computers running OCS Inventory NG agent to scan for MAC addresses in their sub network at each run. See Section 7 in the internal OCS help file.

Modifying default behaviour

You may want to override the default IP Discovery behaviour.

To force a computer to ipdiscover, simply open its inventory. Click on Customization icon and update the ipdiscover behaviour. OCS-ipdiscover-step1.png


Now choose the IP of selected computer and save your changes. OCS-ipdiscover-step2.png


You should now see your modifications.

OCS-ipdiscover-step3.png
At this point, ipdiscover will run next time with the agent!

Manually launch the inventory to force ipdiscover or wait a day for the next inventory.


Adding networks and devices categories

Now click on Security and go to Config OCS-ipdiscover-step4.png


Add you own network/subnet. All fields are mandatory. OCS-ipdiscover-step5.png


We can also add categories. Let's do that! Click on 'Network devices types' OCS-ipdiscover-step6.png


Usage

Go back to Security and click on Network information. Now that your network is created, you should see ipdiscover working...

Click on non-inventoried devices. OCS-ipdiscover-step7.png


Now all you have to do is registering new devices! OCS-ipdiscover-step8.png


OCS-ipdiscover-step9.png


Deploying packages

OCS Inventory NG includes package deployment feature on client computers. From the central management server, you can upload packages which will be downloaded through HTTP/HTTPS and launched by agent on client computer. See Section 8 in the internal OCS help file.

This feature is LAN ONLY

SSL certificate

Deployment feature uses SSL to authenticate Agents.

To allow the Agent to authenticate with the Server, you need to copy the cacert.pem file in your agents' installation directory

This file is located in /home/e-smith/ssl.crt/

Using default cacert.pem

If the file /home/e-smith/ssl.crt/cacert.pem can not be found, the RPM install will create it by copying your original SME certificate into this file. This is a quick and a simple method.

Copy the cacert.pem file in your agents' installation directory. Skip to next section!

Using a custom certificate

If you've followed this howto to create a valid certificate, you can use this certificate with OCS Deployment feature.

Download cacert.org certificate with the following command:

wget http://www.cacert.org/certs/root.crt

And replace the old file with the following command:

cp root.crt /home/e-smith/ssl.crt/cacert.pem

Copy this file into your agents' installation directory.

Deployment menu

Open OCS' web interface and click on Deployment icon. OCS-deployment-menu.png


Building a deployment packages

Deployment packages can be either .zip files (Windows) or tar.gz files (Linux)

Don't try to deploy other file type.

There are many options to deploy packages, for an overview see the ocs website for detail see section 8.3 of the help file, for Tips and tricks see Pablo Iranzo's site OCS-buildpackage.png


After creating the deployment package, you should get this successful screen: OCS-success-build.png


Activating deployment packages

Once a package is added, you need to activate it. OCS-activate-package1.png


Provide paths to download folder. As this feature is LAN ONLY, provide internal name or IP address for both fields.

Be careful, this path will be resolved by the agent (value localhost forbidden here!)

OCS-activate-package2.png


Don't pay attention to the warning messages when activating, Just click Yes. OCS-activate-package3.png


You can also ignore any warning messages when deleting a package, the package is removed.

Activated deployment packages

Here you will be able to see activated packages... OCS-activated-package.png

Deploying your packages

All should be ready to go now!

The final step is to affect the created package to computers...

Here's a quick howto for deploying the package on a single computer.

To learn how to deploy on multiple computers, see section 8.5 of the help file.


Open the desired computer's inventory on click on Config icon and add a new package OCS-deploy-single-pc1.png


You should see all activated packages, affect the one you want and confirm changes OCS-deploy-single-pc2.png


Back at Config page, you should now see affected packages and their states. OCS-deploy-single-pc3.png


Next time the Agent contacts the server, it is notified of the package, and sometime later should be deployed! As usual, you can manually launch the agent to force the update.

See section 8.1 of the help file to understand how download works