Problem to store Last values into database.

Started by vargaata, August 07, 2018, 11:44:31 PM

Previous topic - Next topic

vargaata

I upgraded my Slackware installation from 14.2 to the latest and NetXMS from 2.0.7 to 2.2.7. During the upgrade I had to delete netxms database: DROP DATABASE netxms; . I compiled NetXMS from source with following options: ./configure --with-server --with-agent --with-snmp --with-mariadb --disable-mqtt --disable-ipv6.
After I created the new database, NetXMS started correctly, but not saving any real data from "Last values". It stores values with 01.01.1970 01:00:00 Time Stamp and 0 Value.

There are no errors reported in MariaDB and NetXMS logfiles. MariaDB version is: 10.3.8.

Can somebody help me, what to check, please?

vargaata

The strange thing is, when I do a query with mysql CLI from database, for examle: SELECT idata_timestamp,idata_value FROM netxms.idata_114 WHERE item_id = 109; I can see the correct values with timestamp. Do not know how to translate idata_timestamp to real date and time yet, but idata_value is correct.

It looks like, the data stored correcly in the database, just the NetXms client (PC and Mobile) cannot display it.

Thanks.

Victor Kirhenshtein

Hi,

it's problem with reading data from database, not with storing. It is caused by bug in MariaDB client library https://jira.mariadb.org/browse/CONC-281. It is supposed to be fixed in latest client version, but could be not. Our MariaDB driver has check for client version that activates workaround - maybe it erroneously assumes version number where this issue was fixed. You can try to find the following lines in src/db/dbdrv/mariadb/mariadb.cpp:


/* workaround for MariaDB C Connector bug CONC-281 */
if (mysql_get_client_version() < 100209)  // for any client before 10.2.9
{
    mysql_stmt_store_result(hStmt->statement);
}


and comment out version check so it will look like this:

/* workaround for MariaDB C Connector bug CONC-281 */
//if (mysql_get_client_version() < 100209)  // for any client before 10.2.9
{
    mysql_stmt_store_result(hStmt->statement);
}


then recompile MariaDB driver.

Best regards,
Victor

vargaata

Hello Victor,

Thanx for your answer. I followed your suggestion and modified the source file. It was successful. I can see stored values now.

Thank you very much,
Best regards,
Attila.