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 of compatibility with old agent

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.

ago in OCS Inventory NG server for Unix by (120 points)

1 Answer

0 votes
Starting from Server 2.2, it's easy to upgrade using xxxx.sql files in folder files/updates (and at the end adjust GUI_VERSION with the last xxxx).

But before 2.2, you need to find yourself database schema modification : the best is looking for database schema with a tools like phpmyadmin or adminer, for each tables and add all columns necessary.
ago by (20.9k points)
 
Powered by Question2Answer
...