OCSInventory-NG / OCSInventory-ocsreports

Webconsole for OCS Inventory NG
https://www.ocsinventory-ng.org
GNU General Public License v2.0
230 stars 150 forks source link

Does not record inventory #1611

Open iRoot13x18 opened 3 months ago

iRoot13x18 commented 3 months ago

OCS Inventory version Server : 2.12.1 Agent : 2.10.1.0

Describe the bug I have two servers, one with ocs inventory server and the other for the mariadb database, when I install ocs inventory and want to test the inventory by installing the agent on a computer it does not register in ocs.

To Reproduce

Steps to reproduce the behavior:

1.Basic installation of ocs inventory server 2.Running an agent on a computer to test the inventory

Expected behavior I just did this and I'm getting this error, I had tried it before but with the database on the same server as the ocs inventory and it worked perfectly.

Agent Log COM SERVER => Initializing cURL library for sendRequest COM SERVER => Using cURL without server authentication COM SERVER => Disabling cURL proxy support COM SERVER => Disabling cURL SSL server validation support COM SERVER => Sending HTTP Post request to URL https://ocsinventory.domain.com/ocsinventory COM SERVER => HTTP Post response received <HTTP Status Code #500> COM SERVER => Cleaning cURL library ERROR *** AGENT => Failed to send Prolog <HTTP Status Code #500> AGENT => Unloading communication provider AGENT => Unloading plug-in(s) AGENT => Execution duration: 00:00:00.

gillesdubois commented 3 months ago

Hi,

An error 500 mean there is an issue on the server side (communication server).

Make sure your z-ocsinventory-server.conf point to your mariadb database. If your apache error log is not detailled enough, you can enable DBI_PRINT_ERROR in the file mentionned above.

Regards, Gilles DUBOIS.

iRoot13x18 commented 3 months ago

thanks for your answer, in the configuration it is already pointing to the database and still nothing.

Salbei commented 2 months ago

I have the same problem with RPM install on Rocky Linux 9.

Server : 2.12.1 Agent : 2.10.1.0

After enable DBI verbosity, I can see that: DBD::mysql::st execute failed: Table 'ocsweb.software' doesn't exist at /usr/share/perl5/vendor_perl/Apache/Ocsinventory/Server/Inventory/Software.pm line 64.

charleneauger commented 3 weeks ago

Hi @Salbei ,

In 2.12.2 version, we fixed software table creation. See the next PR https://github.com/OCSInventory-NG/OCSInventory-ocsreports/pull/1590.

Below, the query to create the software table:

CREATE TABLE `software` (
  `ID` bigint NOT NULL AUTO_INCREMENT,
  `HARDWARE_ID` int NOT NULL,
  `NAME_ID` int NOT NULL,
  `PUBLISHER_ID` int NOT NULL,
  `VERSION_ID` int NOT NULL,
  `FOLDER` text,
  `COMMENTS` text,
  `FILENAME` varchar(255) DEFAULT NULL,
  `FILESIZE` int DEFAULT '0',
  `SOURCE` int DEFAULT NULL,
  `GUID` varchar(255) DEFAULT NULL,
  `LANGUAGE` varchar(255) DEFAULT NULL,
  `INSTALLDATE` datetime DEFAULT NULL,
  `BITSWIDTH` int DEFAULT NULL,
  `ARCHITECTURE` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`ID`),
  KEY `HARDWARE_ID` (`HARDWARE_ID`),
  KEY `NAME_ID` (`NAME_ID`),
  KEY `PUBLISHER_ID` (`PUBLISHER_ID`),
  KEY `VERSION_ID` (`VERSION_ID`),
  KEY `HARDWARE_ID_2` (`HARDWARE_ID`, `NAME_ID`, `VERSION_ID`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

Best regards, Charlene