[ZBX-25071] MSSQL for Zabbix Agent 2 perfcounter query issue Created: 2024 Aug 19  Updated: 2024 Nov 25  Resolved: 2024 Nov 25

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent2 plugin (G)
Affects Version/s: None
Fix Version/s: 6.0.36rc1, 7.0.6rc1, 7.2.0rc1

Type: Problem report Priority: Trivial
Reporter: Brian Coverstone Assignee: Aleksandr Kotsegubov
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File perfcounter.get.sql    
Team: Team INT
Story Points: 1

 Description   

Steps to reproduce:

  1. If you run the MSSQL plugin on system with a non-named instance, it will fail to pull values due to a naming mistake from the sys.dm_os_performance_counters table. This is due to an issue in the perfcounter.get.sql file that doesn't take the default SQL name into account when it is not a named instance.

This can be fixed with the following addition:

DECLARE @SQLNAME NVARCHAR(50)
SET @SQLNAME = CASE WHEN @@SERVICENAME = 'MSSQLSERVER' THEN 'SQLServer' ELSE 'MSSQL$' + @@SERVICENAME END

I have attached a corrected perfcounter.get.sql file with this addition, including the variable replacements.



 Comments   
Comment by Aleksandr Kotsegubov [ 2024 Nov 13 ]

Fixed in task ZBX-25096

 

Templates changes available in:

 

MSSQL plugin for Zabbix agent2 changes available in:

Generated at Fri Apr 04 12:35:17 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.