Hello,
we use OCS inventory 2.1 RC1 on a old CentOS 5.x with Mysql 4.
Recently, we create a new server (ubuntu LTS 24.x) with the last version of OCS Inventory (2.12.3) and MariaDB (10.11.13).
We encounter multiples problems, as we used a very old version, as:
- update the database shema (detect incorrect version of database : we executed manually all sql file since the correct version)
- the installer clear the database after set database parameters (value of GUI_VERSION was too old in database : i manually update the value)
- ...
But it works now :)
We started to update few agents and notice that it not works with the new server.
When we start agent, communication works with server (code 200), but when it tries to do do report, it fails (code 500).
After some researches, we enable OCS_OPT_DBI_PRINT_ERROR in /etc/apache2/conf-enabled/z-ocsinventory-server.conf, and we found in /var/log/apache2/error.log :
DBD::mysql::st execute failed: Unknown column 'SERVERNAME' in 'INSERT INTO' at /usr/share/perl5/Apache/Ocsinventory/Server/Inventory/Update.pm line 173.
We discovered that some agents create reports with fields that not exist in database, as :
- Windows agent 2.1.1.3 under Windows 11
- MacOS Agent 2.1.x/2.3.x/2.4.x/2.6.x/2.8.x under MacOSX 10.13.x
With Ocs Inventory 2.1, the server ignore the values but not the version 2.12.3.
The problem seems come from printers part :
<PRINTERS>
<NAME>Microsoft Print to PDF</NAME>
<DRIVER>Microsoft Print To PDF</DRIVER>
<PORT>PORTPROMPT:</PORT>
<SERVERNAME />
<SHARENAME />
<RESOLUTION>600 x 600</RESOLUTION>
<COMMENT />
<SHARED>0</SHARED>
<NETWORK>0</NETWORK>
</PRINTERS>
We will update the agents to the last version for all computers compatibles, but as we have a lot of old computers, we solved the problem by adding the fields in database :
- ALTER TABLE printers ADD COLUMN SERVERNAME varchar(255) after DESCRIPTION;
- ALTER TABLE printers ADD COLUMN RESOLUTION varchar(255) after DESCRIPTION;
- ALTER TABLE printers ADD COLUMN SHARED varchar(255) after DESCRIPTION;
- ALTER TABLE printers ADD COLUMN NETWORK varchar(255) after DESCRIPTION;
- ALTER TABLE printers ADD COLUMN COMMENT varchar(255) after DESCRIPTION;
- ALTER TABLE printers ADD COLUMN SHARENAME varchar(255) after DESCRIPTION;
I hope this could help some people, and the next version of Ocs Inventory server fix the problem.