Welcome to OCS Inventory NG community support, where you can ask questions and receive answers from other members of the community.

Please ask questions only in English or French.

Release 2.11.1 available

The official documentation can be found on http://wiki.ocsinventory-ng.org. Read it before asking your question.

Problème de remontée d'inventaire

Bonjour,

J'ai réussi à installer un OCS Server sous Ubuntu 15.10 (Version 2.2.1)

Pour mes machines Windows, je déploie l'agent OCS Inventory via une GPO qui marche super bien.

Le problème c'est qui'il n'y a pas de remontée d'inventaire vers mon serveur OCS Inventory. (Aucune machine n'apparaît dans mon interface ocsreports.

Quand je lance "Afficher les informations d'inventaire" (clic droit sur l'icone de l'agent OCS installé sur ma machine), j'ai le message d'erreur suivant : PJ

Merci de bien vouloir m'orienter vers une bonne piste 

in OCS Inventory NG agent for Windows by (320 points)

1 Answer

0 votes
Bonjour,

Pourriez-vous fournir les logs de l'agent ?  C:\ProgramData\OCS Inventory NG\Agent\OCSInventory.log

Merci
by (6.9k points)
Bonjour,

Merci à vous de m'avoir répondue!!

Voici un extrait des logs de l'agent :

==============================================================================
Starting OCS Inventory NG Agent on Wednesday, August 17, 2016 08:02:25.
AGENT => Running OCS Inventory NG Agent Version 2.1.1.3
AGENT => Using OCS Inventory NG FrameWork Version 2.1.1.3
AGENT => Loading plug-in(s)
AGENT => Using network connection with Communication Server
AGENT => Using Communication Provider <OCS Inventory NG cURL Communication Provider> Version <2.1.1.3>
AGENT => Sending Prolog
ERROR *** AGENT => Failed to send Prolog <HTTP Status Code #404>
AGENT => Unloading communication provider
AGENT => Unloading plug-in(s)
AGENT => Execution duration: 00:00:01.

Sinon, j'ai essayé de désactiver les pare-feux de ma machine...je n'ai plus le message d'erreur que j'ai déjà posté; Pourtant, il n'y a pas de remontée d'inventaire!!
Contenu du fichier ocsinventory.ini :

[OCS Inventory Agent]
ComProvider=ComHTTP.dll
Debug=0
Local=
NoSoftware=0
HKCU=0
NoTAG=0
IpDisc=
[HTTP]
Server=http://x.x.x.x/ocsinventory:80/ocsinventory
SSL=1
CaBundle=cacert.pem
AuthRequired=0
User=
Pwd=
ProxyType=0
Proxy=
ProxyPort=0
ProxyAuthRequired=0
ProxyUser=
ProxyPwd=
[OCS Inventory Service]
PROLOG_FREQ=24
OLD_PROLOG_FREQ=24
TTO_WAIT=3120

L'url du server n'est pas bonne,

ICI http://x.x.x.x/ocsinventory:80/ocsinventory

Devrait être http://x.x.x.x/ocsinventory tout simplement

Je dois donc modifier mon fichier ocsinventory.ini
Exactement ! J'attend votre retour
J'ai effectué la modification, mais malheureusement, la machine n'apparait pas sur l'interface ocsreports
Encore une fois, pouvez-vous renvoyer les nouvelles logs ?
Contenu de C:\ProgramData\OCSInventoryNG\Agent\ocsinventory.log.bak :

==============================================================================
Starting OCS Inventory NG Agent on Thursday, August 18, 2016 11:34:42.
AGENT => Running OCS Inventory NG Agent Version 2.1.1.3
AGENT => Using OCS Inventory NG FrameWork Version 2.1.1.3
AGENT => Loading plug-in(s)
AGENT => Using network connection with Communication Server
AGENT => Using Communication Provider <OCS Inventory NG cURL Communication Provider> Version <2.1.1.3>
AGENT => Sending Prolog
AGENT => Prolog successfully sent
SUPPORT => No support detected, Registration key : N/A
AGENT => Unloading communication provider
AGENT => Unloading plug-in(s)
AGENT => Execution duration: 00:00:03.

==============================================================================
Starting OCS Inventory NG Agent on Thursday, August 18, 2016 12:01:38.
AGENT => Running OCS Inventory NG Agent Version 2.1.1.3
AGENT => Using OCS Inventory NG FrameWork Version 2.1.1.3
AGENT => Loading plug-in(s)
AGENT => Using network connection with Communication Server
AGENT => Using Communication Provider <OCS Inventory NG cURL Communication Provider> Version <2.1.1.3>
AGENT => Sending Prolog
AGENT => Prolog successfully sent
SUPPORT => No support detected, Registration key : N/A
AGENT => Unloading communication provider
AGENT => Unloading plug-in(s)
AGENT => Execution duration: 00:00:00.
L'inventaire est bien parti au serveur ici. Aucun autre soucis ?

Effectivement!!

Pourtant aucune machine n'apparait dans l'inventaire d'ocsreports

La configuration de la base de donnés pour l'ocsreport et la configuration apache est bien la même ?
Comment puis-je comparer ces configurations?
Tout simplement ouvrir les deux fichiers ?

Un simple cat ?
Configuration de z-ocsinventory-server.conf :
<IfModule mod_perl.c>
   # Which version of mod_perl we are using
  # For mod_perl <= 1.999_21, replace 2 by 1
  # For mod_perl > 1.999_21, replace 2 by 2
  PerlSetEnv OCS_MODPERL_VERSION 2
  # Master Database settings
  # Replace localhost by hostname or ip of MySQL server for WRITE
  PerlSetEnv OCS_DB_HOST localhost
  # Replace 3306 by port where running MySQL server, generally 3306
  PerlSetEnv OCS_DB_PORT 3306
  # Name of database
  PerlSetEnv OCS_DB_NAME ocsweb
  PerlSetEnv OCS_DB_LOCAL ocsweb
  # User allowed to connect to database
  PerlSetEnv OCS_DB_USER ocs
  # Password for user
  PerlSetVar OCS_DB_PWD ocs
  # Slave Database settings
  # Replace localhost by hostname or ip of MySQL server for READ
  # Useful if you handle mysql slave databases
  # PerlSetEnv OCS_DB_SL_HOST localhost
  # Replace 3306 by port where running MySQL server, generally 3306
  # PerlSetEnv OCS_DB_SL_PORT_SLAVE 3306
  # User allowed to connect to database
  # PerlSetEnv OCS_DB_SL_USER ocs
  # Name of the database
  # PerlSetEnv OCS_DB_SL_NAME ocsweb
  # Password for user
  # PerlSetVar OCS_DB_SL_PWD ocs
    # Path to log directory (must be writeable)
  PerlSetEnv OCS_OPT_LOGPATH "/var/log/ocsinventory-server"
    # If you need to specify a mysql socket that the client's built-in
  #PerlSetEnv OCS_OPT_DBI_MYSQL_SOCKET "path/to/mysql/unix/socket"
  # DBI verbosity
  PerlSetEnv OCS_OPT_DBI_PRINT_ERROR 0
    # Unicode support
  PerlSetEnv OCS_OPT_UNICODE_SUPPORT 1
   # If you are using a multi server architecture,
  # Put the ip addresses of the slaves on the master
  # (This is read as perl regular expressions)
  PerlAddVar OCS_OPT_TRUSTED_IP 127.0.0.1
  #PerlAddVar OCS_OPT_TRUSTED_IP XXX.XXX.XXX.XXX
sous ocsreports, le fichier dbconfig.inc.php :

<?php
define("DB_NAME", "ocs");
define("SERVER_READ","localhost");
define("SERVER_WRITE","localhost");
define("COMPTE_BASE","ocs");
define("PSWD_BASE","ocs");
?>
Il y a un soucis de nom de base. Pour l'ocsreport la base est "ocs" alors que pour la conf perl la base est "ocsweb"
Puis-je modifier manuellement ou réinstaller l'ocs carrément??

Aucun soucis de modifier manuellement suffit de changer dans la conf apache 
  PerlSetEnv OCS_DB_NAME ocsweb
  PerlSetEnv OCS_DB_LOCAL ocsweb

  PerlSetEnv OCS_DB_NAME ocs
  PerlSetEnv OCS_DB_LOCAL ocs

Désolée pour ce retard!!

En réalité j'ai recommencé la quasi totalité du travail...j'avais réinstallé l'Ocsinventory NG version 2.1.2; pourtant j'ai gardé la même GPO d'installation de l'agent OCS pour mes machines Windows.

Malheureusement, l'inventaire se fait localement mais ne s'affiche pas sur l'interface ocsreports!!

z-ocsinventory-server.conf :

IfModule mod_perl.c>
 
  # Which version of mod_perl we are using
  # For mod_perl <= 1.999_21, replace 2 by 1
  # For mod_perl > 1.999_21, replace 2 by 2
  PerlSetEnv OCS_MODPERL_VERSION 2

  # Master Database settings
  # Replace localhost by hostname or ip of MySQL server for WRITE
  PerlSetEnv OCS_DB_HOST localhost
  # Replace 3306 by port where running MySQL server, generally 3306
  PerlSetEnv OCS_DB_PORT 3306
  # Name of database
  PerlSetEnv OCS_DB_NAME ocsweb
  PerlSetEnv OCS_DB_LOCAL ocsweb
  # User allowed to connect to database
  PerlSetEnv OCS_DB_USER ocs
  # Password for user
  PerlSetVar OCS_DB_PWD XXXXX

  # Slave Database settings
  # Replace localhost by hostname or ip of MySQL server for READ
  # Useful if you handle mysql slave databases
  # PerlSetEnv OCS_DB_SL_HOST localhost
  # Replace 3306 by port where running MySQL server, generally 3306
  # PerlSetEnv OCS_DB_SL_PORT_SLAVE 3306
  # User allowed to connect to database
  # PerlSetEnv OCS_DB_SL_USER ocs
  # Name of the database
  # PerlSetEnv OCS_DB_SL_NAME ocsweb
  # Password for user
  # PerlSetVar OCS_DB_SL_PWD ocs

dbconfig.inc.php :

<?php
define("DB_NAME", "ocsweb");
define("SERVER_READ","localhost");
define("SERVER_WRITE","localhost");
define("COMPTE_BASE","ocs");
define("PSWD_BASE","XXXXX");
?>
Voici le script de déploiement de l'agent OCS par GPO :

REM **** This is the fully qualified domain name of your OCS Inventory ng server.
set OCSSERVER=http://X.X.X.X/ocsinventory

REM **** Network port used by apache
REM **** If different change it. Ex. 8080
set PORT=80

REM **** You must put here the address of your file server where OCS-NG-Windows-Agent-Setup.exe is.
REM **** For exemple :
REM **** If OCS-NG-Windows-Agent-Setup.exe is on \\filesserver\public\ocs\OCS-NG-Windows-Agent-Setup.exe
REM **** you must put : fileserver\public\ocs
set INSTALLSERVER=Mon_serveur_AD\ocs_agent

REM **** Set to ON if you want install the SSL certificat and activate deployement feature
REM **** before enable it : put the file cacert.pem on the sames directory as OCS-NG-Windows-Agent-Setup.exe
set DEPLOYE=ON

IF %PROCESSOR_ARCHITECTURE%==x86 SET INSTALLDIR=%ProgramFiles%
IF %PROCESSOR_ARCHITECTURE%==AMD64 SET INSTALLDIR=%ProgramFiles(x86)%

IF EXIST "%INSTALLDIR%\OCS Inventory agent\OCSInventory.exe" goto upgrade

:install
\\%INSTALLSERVER%\OCS-NG-Windows-Agent-Setup /S /SERVER=%OCSSERVER%:%PORT%/ocsinventory /NOSPLASH /DEBUG /NOW
cd "%INSTALLDIR%\OCS Inventory agent\"
echo pwouet > %VERSION%.txt
goto end

:upgrade
IF EXIST "%INSTALLDIR%\OCS Inventory agent\%VERSION%.txt" goto end
\\%INSTALLSERVER%\OCS-NG-Windows-Agent-Setup /S /SERVER=%OCSSERVER%:%PORT%/ocsinventory /NOSPLASH /DEBUG /NOW
cd "%INSTALLDIR%\OCS Inventory agent\"
echo pwouet > %VERSION%.txt

:end
IF NOT %DEPLOYE%==ON goto endend
IF EXIST "%INSTALLDIR%\OCS Inventory NG\Agent\cacert.pem" goto endend
xcopy \\%INSTALLSERVER%\cacert.pem "%ALLUSERSPROFILE%\OCS Inventory agent\" /Y

:endend

*******************************

Le problème c'est que je n'est pas "cacert.pem" dans le répertoire Mon_serveur_AD\ocs_agent (emplacement de l'agent à installer)
Normalement, même sans certificat les ordinateurs devraient être remontés. Le certificat est utilise uniquement en cas déploiemet. Pourriez-vous m'envoyer les logs d'execution de l'agent ?
ocsinventory.log.bak :

==============================================================================
Starting OCS Inventory NG Agent on Wednesday, August 24, 2016 09:40:25.
AGENT => Running OCS Inventory NG Agent Version 2.1.1.3
AGENT => Using OCS Inventory NG FrameWork Version 2.1.1.3
AGENT => Loading plug-in(s)
AGENT => Using network connection with Communication Server
AGENT => Using Communication Provider <OCS Inventory NG cURL Communication Provider> Version <2.1.1.3>
AGENT => Writing configuration to file <C:\ProgramData\OCS Inventory NG\Agent\ocsinventory.ini>
AGENT => Unloading communication provider
AGENT => Unloading plug-in(s)
AGENT => Execution duration: 00:00:02.

==============================================================================
Starting OCS Inventory NG Agent on Wednesday, August 24, 2016 09:40:29.
AGENT => Running OCS Inventory NG Agent Version 2.1.1.3
AGENT => Using OCS Inventory NG FrameWork Version 2.1.1.3
AGENT => Loading plug-in(s)
AGENT => Using network connection with Communication Server
AGENT => Using Communication Provider <OCS Inventory NG cURL Communication Provider> Version <2.1.1.3>
AGENT => Sending Prolog
ERROR *** AGENT => Failed to send Prolog <HTTP Status Code #404>
AGENT => Unloading communication provider
AGENT => Unloading plug-in(s)
AGENT => Execution duration: 00:00:01.

Localement, l'inventaire s'affiche bien : 

 
Powered by Question2Answer
...