feat(inputs.sqlserver): add @@SERVICENAME and SERVERPROPERTY(''IsClustered'') in measurement sqlserver_server_properties (#12351)

This commit is contained in:
goswamisandeep 2022-12-09 23:54:57 +05:30 committed by GitHub
parent 7df97486d4
commit 5eee8faa95
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -214,6 +214,7 @@ SET @SqlStatement = '
SELECT
''sqlserver_server_properties'' AS [measurement]
,REPLACE(@@SERVERNAME,''\'','':'') AS [sql_instance]
,@@SERVICENAME AS [service_name]
,si.[cpu_count]
,(SELECT [total_physical_memory_kb] FROM sys.[dm_os_sys_memory]) AS [server_memory]
,(SELECT [available_physical_memory_kb] FROM sys.[dm_os_sys_memory]) AS [available_server_memory]
@ -221,6 +222,7 @@ SELECT
,CAST(SERVERPROPERTY(''EngineEdition'') AS int) AS [engine_edition]
,DATEDIFF(MINUTE,si.[sqlserver_start_time],GETDATE()) AS [uptime]
,SERVERPROPERTY(''ProductVersion'') AS [sql_version]
,SERVERPROPERTY(''IsClustered'') AS [instance_type]
,LEFT(@@VERSION,CHARINDEX('' - '',@@VERSION)) AS [sql_version_desc]
,dbs.[db_online]
,dbs.[db_restoring]