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.12.3 available

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

Problem When Trying to send Inventory

I have a fresh installation of the last version of OCS on a centos server.

I have a windows 7 pc with OCS Agent installed. Nothing append when I launch inventory. I can't see the computer on OCS reports.

In the Agent logs i can see :

COM SERVER => Sending HTTP Post request to URL <http://ocs-srv.dagimport.com/ocsinventory>

COM SERVER => HTTP Post response received <HTTP Status Code #500>

COM SERVER => Cleaning cURL library

ERROR *** AGENT => Failed to send Inventory <HTTP Status Code #500>

AGENT =>  Communication Server ask for Package Download

DOWNLOAD => Package history file successfully cleaned for duplicate IDs

DOWNLOAD => Download disabled by server

I check my mysql server configuration and evrything is ok :

<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 test

Here is my apache error.log :

192.168.21.248 - - [26/Jul/2017:20:52:08 +0200] "GET /ocsinventory/deploy/label HTTP/1.1" 400 226 "-" "OCS-NG_WINDOWS_AGENT_v2.0.5.0"
192.168.21.248 - - [26/Jul/2017:20:52:09 +0200] "POST /ocsinventory HTTP/1.1" 200 234 "-" "OCS-NG_WINDOWS_AGENT_v2.0.5.0"
192.168.21.248 - - [26/Jul/2017:20:52:32 +0200] "POST /ocsinventory HTTP/1.1" 500 527 "-" "OCS-NG_WINDOWS_AGENT_v2.0.5.0"
192.168.21.248 - - [26/Jul/2017:20:53:27 +0200] "GET /ocsinventory/deploy/label HTTP/1.1" 400 226 "-" "OCS-NG_WINDOWS_AGENT_v2.0.5.0"
192.168.21.248 - - [26/Jul/2017:20:53:27 +0200] "POST /ocsinventory HTTP/1.1" 200 234 "-" "OCS-NG_WINDOWS_AGENT_v2.0.5.0"
192.168.21.248 - - [26/Jul/2017:20:53:49 +0200] "POST /ocsinventory HTTP/1.1" 500 527 "-" "OCS-NG_WINDOWS_AGENT_v2.0.5.0"

Could someone help me please? I checked everything before posting here.

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

15 Answers

0 votes
Do you check your selinux configuration ?
by (380 points)
0 votes

Thank you for you answer. Yes I checked this. SElinux is disabled. Do you have any other idea? How can I know why I have an error 500 when I try to send inventory from client to server?

by (480 points)
0 votes
Try this :

Stop your httpd deaomon

Erase your apache log (or move in an other directory)

Restart httpd

Make an inventory

Read the log /var/log/httpd/error_log

I had the the same problem and find the solution with this log (unfortunetly i forget the solutionj :/)
by (380 points)
0 votes
Ok i did it. Here is the result :

ocsinventory-server: Bad setting. `DOWNLOAD_EXECUTION_TIMEOUT` is not set. Default: `120`
ocsinventory-server: Bad setting. `INVENTORY_ON_STARTUP` is not set. Default: `0`
[Thu Jul 27 12:28:01.602957 2017] [suexec:notice] [pid 2970] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
ocsinventory-server: Bad setting. `DOWNLOAD_EXECUTION_TIMEOUT` is not set. Default: `120`
ocsinventory-server: Bad setting. `INVENTORY_ON_STARTUP` is not set. Default: `0`
[Thu Jul 27 12:28:02.136719 2017] [auth_digest:notice] [pid 2970] AH01757: generating secret for digest authentication ...
[Thu Jul 27 12:28:02.138144 2017] [lbmethod_heartbeat:notice] [pid 2970] AH02282: No slotmem from mod_heartmonitor
[Thu Jul 27 12:28:02.196903 2017] [mpm_prefork:notice] [pid 2970] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips PHP/5.4.16 mod_perl/2.0.10 Perl/v5.16.3 configured -- resuming normal operations
[Thu Jul 27 12:28:02.196963 2017] [core:notice] [pid 2970] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

Where can I find the reason of the problem?
by (480 points)
0 votes
ocsinventory-server: Bad setting. `DOWNLOAD_EXECUTION_TIMEOUT` is not set. Default: `120`
ocsinventory-server: Bad setting. `INVENTORY_ON_STARTUP` is not set. Default: `0`
[Thu Jul 27 12:28:01.602957 2017] [suexec:notice] [pid 2970] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
ocsinventory-server: Bad setting. `DOWNLOAD_EXECUTION_TIMEOUT` is not set. Default: `120`
ocsinventory-server: Bad setting. `INVENTORY_ON_STARTUP` is not set. Default: `0`

-> forced this value in your configuration  ?
by (380 points)
0 votes

Done, steel the same result :

[Thu Jul 27 14:27:06.486742 2017] [suexec:notice] [pid 3185] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Thu Jul 27 14:27:07.055454 2017] [auth_digest:notice] [pid 3185] AH01757: generating secret for digest authentication ...
[Thu Jul 27 14:27:07.056870 2017] [lbmethod_heartbeat:notice] [pid 3185] AH02282: No slotmem from mod_heartmonitor
[Thu Jul 27 14:27:07.113163 2017] [mpm_prefork:notice] [pid 3185] AH00163: Apache/2.4.6 (CentOS) OpenSSL/1.0.1e-fips PHP/5.4.16 mod_perl/2.0.10 Perl/v5.16.3 configured -- resuming normal operations
[Thu Jul 27 14:27:07.113225 2017] [core:notice] [pid 3185] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'

Nothing in my server inventory ans steel the same error in agent logs :

COM SERVER => HTTP Post response received <HTTP Status Code #500>

COM SERVER => Cleaning cURL library

ERROR *** AGENT => Failed to send Inventory <HTTP Status Code #500>

AGENT =>  Communication Server ask for Package Download

DOWNLOAD => Package history file successfully cleaned for duplicate IDs

DOWNLOAD => Download disabled by server

AGENT => Unloading communication provider

AGENT => Unloading plug-in(s)

AGENT => Execution duration: 00:00:24.

Could you tell me where I can find why I have this error. Error 500 has no signification...

by (480 points)
edited by
0 votes
Can someone help me please? I just want to know where i can found the log to know why I have an error 500.

Thanks
by (480 points)
0 votes
https://www.ocsinventory-ng.org/en/rpm-repository-is-available-for-rhelcentosfedora/

You can install OCS by RPM on Centos. It will work better :)
by (22k points)
0 votes
It is exactly what I did. I don't understand : there is no logs on OCS server? You can't know what is wrong when you have a problem?

Thanks for your help.
by (480 points)
–1 vote

Try to install with the script . I put here my install documentation (it is in french ... blush)

Centos 7 install

Installation du depot EPEL + paquets utiles : yum install wget vim epel-release net-tools glances bzip2

Telecharger le dernier RPM webtatic release https://mirror.webtatic.com/yum/el7/ webtatic-release.rpm

Installation du depot "webtatic" : rpm -ivh webtatic-release.rpm

Installation du depot pour mariadb : touch /etc/yum.repos.d/mariadb.repo + 

# MariaDB 10.1 CentOS repository list - created 2016-10-20 09:04 UTC

http://downloads.mariadb.org/mariadb/repositories/

[mariadb]

name=MariaDB

baseurl=http://yum.mariadb.org/10.1/centos7-amd64

gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB

gpgcheck=1

Installation Apache : yum install httpd

Installation Mysql :yum install MariaDB-server MariaDB

Installation Php : yum install php56w php56w-pdo php56w-mysqlnd php56w-gd php56w-mbstring php56w-ldap php56w-imap php56w-xml

Installation https : yum install mod_ssl openssl

Demarrage auto mysqld et httpd : systemctl enable mariadb; systemctl enable httpd 

OCS install

Créer à l’aide de phpmyadmin ou ligne de commande:

1 base ocs

1 utilisateur ocs_user avec mot de passe fort ayant des droits totale sur la base ocs

Telecharger la dernière release :

https://www.ocsinventory-ng.org/fr

Installer les modules PERL obligatoires pour le fonctionnement du produit

  • yum install perl-XML-Simple
  • yum install perl-Compress-Zlib
  • yum install perl-DBI
  • yum install perl-DBD-MySQL
  • yum install perl-XML-Entities
  • yum install perl-Net-IP
  • yum install perl-SOAP-Lite
  • yum install perl-Archive-Zip
  • yum install perl-Digest-SHA1
  • yum install perl-Test-Simple
  • yum install php56w-soap

Installation d’un Repository supplémentaire pour installer “perl-Apache-DBI”

https://harbottle.gitlab.io/epmel/7/x86_64/

Installation du module

yum install perl-Apache-DBI

décompresser le répertoire d’installation

tar xvf OCSNG_UNIX_SERVER-2.3.1.tar.gz

Déclencher le script d’installation :

. /setup.sh … et laisser les réponses par défaut

Droits supplémentaires

chown apache ocsinventory-reports/

chown -R apache ocsinventory-reports/

chown apache /usr/share/ocsinventory-reports/ocsreports

chown -R apache /usr/share/ocsinventory-reports/ocsreports

Modifier le fichier /etc/httpd/conf.d/Z-ocsinventory-server.conf -> accès BDD

# 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 ocs

  PerlSetEnv OCS_DB_LOCAL ocs

  # User allowed to connect to database

  PerlSetEnv OCS_DB_USER ocs_user

  # Password for user

  PerlSetVar OCS_DB_PWD xxx

Configuration spécifique

Afin de résoudre les problèmes d’affichages :

Ajouter au fichier ocsinventory-reports.conf :

  <IfModule mod_php5.c>

       […]

        php_value default_charset none

       […]

    </IfModule>

Connecter vous au serveur et laisser vous guider

http://x.x.x.x/ocsreports

by (380 points)
 
Powered by Question2Answer
...