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.

Why ocsinventory-server 500 Internal Server Error?

Hello;
I have problem with an ocsinventory-server, when try to open the URL it say "500 Internal Server Error"

My operating system is CentOS7.4 (x86_64) and the ocsinventory is installed from the .rpm of the epel repository. The agent ocsinventory-agent-2.1.1-1.el7.x86_64 and the server ocsinventory-server-2.1.2-3.el7.noarch (both are working on CentOS7.4 Opetating Systems)

When I run "ocsinventory-agente --debug --info" from the PC where is installed the agent this is the error in /var/log/ocsinventory-agent.log:
 
[Wed Nov 29 14:37:24 2017][debug] Ocsinventory unified agent for UNIX, Linux and MacOSX 2.1.1
[Wed Nov 29 14:37:24 2017][debug] Log system initialised (File)
[Wed Nov 29 14:37:24 2017][debug] --scan-homedirs missing. Don't scan user directories
[Wed Nov 29 14:37:24 2017][debug] the --server passed doesn't have a protocol, assume http as default
[Wed Nov 29 14:37:24 2017][debug] Accountinfo file: /var/lib/ocsinventory-agent/http:__gtmrpt.gtm.onat.gob.cu_ocsinventory/ocsinv.adm
[Wed Nov 29 14:37:24 2017][debug] OCS Agent initialised
[Wed Nov 29 14:37:24 2017][debug] Turns hooks on for /etc/ocsinventory/modules.conf
[Wed Nov 29 14:37:24 2017][debug] Ocsinventory unified agent for UNIX, Linux and MacOSX 2.1.1
[Wed Nov 29 14:37:24 2017][debug] Log system initialised (File)
[Wed Nov 29 14:37:24 2017][debug] Ocsinventory unified agent for UNIX, Linux and MacOSX 2.1.1
[Wed Nov 29 14:37:24 2017][debug] Log system initialised (File)
[Wed Nov 29 14:37:24 2017][debug] Calling handlers : `start_handler'
[Wed Nov 29 14:37:24 2017][debug] [download] Calling download_start_handler
[Wed Nov 29 14:37:24 2017][debug]  - LWP loaded
[Wed Nov 29 14:37:24 2017][debug]  - LWP::Protocol::https loaded
[Wed Nov 29 14:37:24 2017][debug] Compress::Zlib is available.
[Wed Nov 29 14:37:24 2017][debug] Calling handlers : `prolog_writer'
[Wed Nov 29 14:37:24 2017][debug] sending XML
[Wed Nov 29 14:37:24 2017][debug] sending: <?xml version="1.0" encoding="UTF-8"?>
<REQUEST>
  <DEVICEID>gtmpve-2017-11-28-16-45-52</DEVICEID>
  <QUERY>PROLOG</QUERY>
</REQUEST>
[Wed Nov 29 14:37:24 2017][error] Cannot establish communication : 500 Internal Server Error

When in the PC with ocinventory-agent I run the command ocsinventory-agent --debug --info in /var/lib/ocsinventory-agent is created a directory with name "http:__gtmrpt.gtm.onat.gob.cu_ocsinventory" and in this are two files ocsinv.adm and ocsinv.conf:

ocsinv.adm

<?xml version="1.0" encoding="UTF-8"?>
<ADM>
</ADM>

ocsinv.conf

<CONF>
  <DEVICEID>gtmpve-2017-11-28-16-45-52</DEVICEID>
</CONF>

In the PC with ocsinventory-server installed the /var/log/httpd/error_log when try to connect to URL http://gtmrpt.gtm.onat.gob.cu/ocsinventory is:

[Wed Nov 29 14:37:24.403920 2017] [perl:error] [pid 26980] [client 192.168.41.16:36106] Can't call method "do" on an undefined value at /usr/share/perl5/vendor_perl/Apache/Ocsinventory/Server/System.pm line 177.\n

In the PC where is installed the agent in /etc/ocsinventory/ocsinventory-agent.cfg I have:

#
# OCS Inventory "Unix Unified Agent" Configuration File
#
# options used by cron job overides this (see /etc/sysconfig/ocsinventory-agent)
#

# Server URL, unconmment if needed
server = http://gtmrpt.gtm.onat.gob.cu/ocsinventory
#local = /var/lib/ocsinventory-agent

# Administrative TAG (optional, must be filed before first inventory)
tag = OCSInventory-GTM

# How to log, can be File,Stderr,Syslog
logger = Stderr
logfile = /var/log/ocsinventory-agent/ocsinventory-agent.log

In option "server" I probe with just gtmrpt.gtm.onat.gob.cu and the result is the same.

In the PC server in /etc/ocsinventory/ocsinventory-reports/dbconfig.inc.php are:

<?php
define("DB_NAME", "ocsweb");
define("SERVER_READ","gtmrpt.gtm.onat.gob.cu");
define("SERVER_WRITE","gtmrpt.gtm.onat.gob.cu");
define("COMPTE_BASE","ocs");
define("PSWD_BASE","estaesmipassword");
?>

and that password in PSWD_BASE is the same that in mysql for the user ocs.

(GRANT ALL ON ocsweb.* TO 'ocs'@'127.0.0.1' IDENTIFIED BY 'estaesmipassword';)
(GRANT ALL ON ocsweb.* TO 'ocs'@'localhost' IDENTIFIED BY 'estaesmipassword';)
(GRANT ALL ON ocsweb.* TO 'ocs'@'gtmrpt.gtm.onat.gob.cu' IDENTIFIED BY 'estaesmipassword';)
(GRANT ALL ON ocsweb.* TO 'ocs'@'192.168.14.10' IDENTIFIED BY 'estaesmipassword';)

The URL http://gtmrpt.gtm.onat.gob.cu/ocsreport is working fine.

If necessary some other info or data.
What I have wrong?
in OCS Inventory NG server for Unix by (120 points)

1 Answer

0 votes

OCS is no more in EPEL (for the moment). I don't know where you find this old version ...

If you want to download the latest version, please follow this link : https://www.ocsinventory-ng.org/en/rpm-repository-is-available-for-rhelcentosfedora/

For your problem, there is a lot of documentation on :

by (22k points)
 
Powered by Question2Answer
...