[ZBX-24754] Errors and weird values using MSSQL ODBC based template Created: 2024 Jun 28 Updated: 2025 Jul 01 |
|
Status: | Open |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | Templates (T) |
Affects Version/s: | 6.0.31 |
Fix Version/s: | None |
Type: | Problem report | Priority: | Trivial |
Reporter: | Sergio Belkin | Assignee: | Aigars Kadikis |
Resolution: | Unresolved | Votes: | 0 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Attachments: |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Description |
There are errors with items such as:
Error happens on preprocessing steps using parameter, for example **
Now it get values but I think they are miscalculated:
|
Comments |
Comment by Aigars Kadikis [ 2024 Jul 01 ] |
Thank you for contacting us. SELECT VERSION(); The template was tested with version 2019. |
Comment by Sergio Belkin [ 2024 Jul 01 ] |
aigars.kadikis Thank you for your response. This the MS SQL Server version: I made the modification a few minutes ago. For now, I don't see any changes. If the history needs to be enabled, how long should it take to see the correct values? |
Comment by Aigars Kadikis [ 2024 Jul 01 ] |
If the host is behind a proxy, it might take up to 1h. |
Comment by Sergio Belkin [ 2024 Jul 01 ] |
No, the host is not behind a proxy, last values :
Sadly for now, the problem persists
|
Comment by Sergio Belkin [ 2024 Jul 01 ] |
aigars.kadikis The problem after a few hours persists: Just in case, I attach the template: zbx_export_templates_mssql-odbc.yaml |
Comment by Sergio Belkin [ 2024 Jul 03 ] |
Hi aigars.kadikis I wonder if it's available a patch or a workaround for this issue. Thanks in advance! |
Comment by Aigars Kadikis [ 2025 Jul 01 ] |
Dear sbelkin I see the template for Zabbix 7.0 looks similar. The master item (SQL SELECT with a lot of UNIONs) contains the same items:
There are 7 SELECT statements in total. If the issue is relevant, see the occurrence of errors on proxy: grep "cannot extract value from json by path.*counter_name.*cntr_value" /var/log/zabbix/zabbix_proxy.log It's helpful to determine whether the dependent items fail simultaneously. For example, if "WorktablesFromCacheRatio" fails, then this part did not work well in master item: SELECT a.object_name, 'WorktablesFromCacheRatio' AS counter_name, '' AS instance_name, cast(a.cntr_value * ISNULL((100.0 / NULLIF(b.cntr_value,0)),0) AS dec(3, 0)) AS cntr_value FROM sys.dm_os_performance_counters a JOIN ( SELECT cntr_value, OBJECT_NAME FROM sys.dm_os_performance_counters WHERE counter_name = 'Worktables From Cache Base' AND OBJECT_NAME = @SQLNAME + ':Access Methods' ) b ON a.OBJECT_NAME = b.OBJECT_NAME WHERE a.counter_name = 'Worktables From Cache Ratio' AND a.OBJECT_NAME = @SQLNAME + ':Access Methods' If it happens frequently, we can manually open SQL client and observe how many rows are reported. Or create another dedicated "Database monitor" item in Zabbix with this small subquery. |