Problems with SQL Backup log since v10.24

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
kb
Posts: 8
Joined: Tue Jan 12, 2021 3:41 am

Problems with SQL Backup log since v10.24

Post by kb »

Since updating to v10.24 the backup logging to MSSQL does not work anymore.
The SQL is unchanged and testing the ODBC data source on the HostMon host is fine.
Testing the Data source in HostMon via Options works fine as well.

The logging itself does not work and throws multiple errors in syslog.
Here are some german examples, shortened and anonymized:

Backup log error. ODBC error code: 4294967295 ([Microsoft][ODBC SQL Server Driver][SQL Server]In der INSERT-Anweisung sind mehr Spalten angegeben als Werte in der VALUES-Klausel. Die Anzahl von Werten in der VALUES-Klausel und die Anzahl von in der INSERT-Anweisung angegebenen Spalten müssen übereinstimmen)

Backup log error. ODBC error code: 4294967295 ([Microsoft][ODBC SQL Server Driver][SQL Server]Falsche Syntax in der Nähe von 'Root'
[Microsoft][ODBC SQL Server Driver][SQL Server]Kein schließendes Anführungszeichen nach der Zeichenfolge ',',LEFT(',499),LEFT(',7999),LEFT(',19),LEFT(',299))')

Thanks in advance
KS-Soft
Posts: 12869
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

We cannot reproduce the problem. What ODBC driver do you use?
Could you send hostmon.ini and .HML file with tests to support (by e-mail)?

Regards
Alex
kb
Posts: 8
Joined: Tue Jan 12, 2021 3:41 am

Post by kb »

The ODBC driver is Microsoft built-in SQL Server driver version 10.00.17763.4974 from 12.10.2023, but that's most likely not the culprit.

The hostmon.ini has the following odbcLogSQLQuery:
Insert into hmlog (eventtime,eventtimestamp,testname,status,statusid,simplestatus,reply,testid,testmethod,testmethodid,testcomment1,testcomment2,testcreatedate,testmodifydate,interval,alertthreshold,hostaddr,folder,fullpath,acknowledgedat,acknowledgedby,ackcomment,httppage,httpcode,httpheader) VALUES ('%DateTime%',getDate(),'%TestName%','%Status%',LEFT('%StatusID%',2),'%SimpleStatus%',LEFT('%Reply%',7999),'%TestID%','%TestMethod%',LEFT('%MethodID%',2),'%CommentLine1%','%CommentLine2%','%CreatedTime%','%ModifiedTime%','%Interval%','%AlertThreshold%','%HostAddr%','%Folder%','%FullPath%','%AcknowledgedAt% ','%AcknowledgedBy%',LEFT('%AckComment%',499),LEFT('%HttpPage%',7999),LEFT('%HttpCode%',19),LEFT('%HttpHeader%',299))

This query worked for years and it did in v10.20 until 8:30 am. I even restored the hostmon.ini from pre-update to make sure the query was exactly the same. The database and the table were not changed and the problem started directly with the upgrade.

For testing purposes I checked the original query from a fresh install / hostmon.ini, created an appropriate table and tested with that query:

Insert into hmlog (eventtime, testname, status, reply, testid, testmethod) VALUES ('%DateTime%', '%TestName%', '%Status%', '%Reply%', %TestID%, '%TestMethod%')

That works flawlessly.
kb
Posts: 8
Joined: Tue Jan 12, 2021 3:41 am

Post by kb »

It seems the variable %FullPath% ist the culprit. If I replace it with a static value the query works fine.
KS-Soft
Posts: 12869
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I think we fixed the problem, please contact support by e-mail and get update

Regards
Alex
KS-Soft
Posts: 12869
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

PS
I assume you updated to version 14.24, not 10.24? This bug affects only version 14.24

Regards
Alex
kb
Posts: 8
Joined: Tue Jan 12, 2021 3:41 am

Post by kb »

Thanks for the quick fix, SQL logging is working again. In fact it partially worked before, it just threw lots of errors and dropped some entries. I assume it had to do with the double backslashes in the full path, or?

And yes, I used 14.24.

Sorry for that typo and once again thanks for the fast help.
KS-Soft
Posts: 12869
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

You are welcome. No, its not backslash related issue

Regards
Alex
Post Reply