fix(inputs.sqlserver): set lower deadlock priority (#11548)
This commit is contained in:
parent
b1546fe1c7
commit
911072c17b
|
|
@ -19,6 +19,7 @@ import (
|
||||||
// and the folks at Stack Overflow (https://github.com/opserver/Opserver/blob/9c89c7e9936b58ad237b30e6f4cc6cd59c406889/Opserver.Core/Data/SQL/SQLInstance.Memory.cs)
|
// and the folks at Stack Overflow (https://github.com/opserver/Opserver/blob/9c89c7e9936b58ad237b30e6f4cc6cd59c406889/Opserver.Core/Data/SQL/SQLInstance.Memory.cs)
|
||||||
// for putting most of the memory clerk definitions online!
|
// for putting most of the memory clerk definitions online!
|
||||||
const sqlServerMemoryClerks = `
|
const sqlServerMemoryClerks = `
|
||||||
|
SET DEADLOCK_PRIORITY -10;
|
||||||
IF SERVERPROPERTY('EngineEdition') NOT IN (2,3,4) BEGIN /*NOT IN Standard,Enterpris,Express*/
|
IF SERVERPROPERTY('EngineEdition') NOT IN (2,3,4) BEGIN /*NOT IN Standard,Enterpris,Express*/
|
||||||
DECLARE @ErrorMessage AS nvarchar(500) = 'Telegraf - Connection string Server:'+ @@ServerName + ',Database:' + DB_NAME() +' is not a SQL Server Standard,Enterprise or Express. Check the database_type parameter in the telegraf configuration.';
|
DECLARE @ErrorMessage AS nvarchar(500) = 'Telegraf - Connection string Server:'+ @@ServerName + ',Database:' + DB_NAME() +' is not a SQL Server Standard,Enterprise or Express. Check the database_type parameter in the telegraf configuration.';
|
||||||
RAISERROR (@ErrorMessage,11,1)
|
RAISERROR (@ErrorMessage,11,1)
|
||||||
|
|
@ -188,6 +189,7 @@ EXEC sp_executesql @SqlStatement
|
||||||
`
|
`
|
||||||
|
|
||||||
const sqlServerProperties = `
|
const sqlServerProperties = `
|
||||||
|
SET DEADLOCK_PRIORITY -10;
|
||||||
IF SERVERPROPERTY('EngineEdition') NOT IN (2,3,4) BEGIN /*NOT IN Standard,Enterpris,Express*/
|
IF SERVERPROPERTY('EngineEdition') NOT IN (2,3,4) BEGIN /*NOT IN Standard,Enterpris,Express*/
|
||||||
DECLARE @ErrorMessage AS nvarchar(500) = 'Telegraf - Connection string Server:'+ @@ServerName + ',Database:' + DB_NAME() +' is not a SQL Server Standard,Enterprise or Express. Check the database_type parameter in the telegraf configuration.';
|
DECLARE @ErrorMessage AS nvarchar(500) = 'Telegraf - Connection string Server:'+ @@ServerName + ',Database:' + DB_NAME() +' is not a SQL Server Standard,Enterprise or Express. Check the database_type parameter in the telegraf configuration.';
|
||||||
RAISERROR (@ErrorMessage,11,1)
|
RAISERROR (@ErrorMessage,11,1)
|
||||||
|
|
@ -241,6 +243,7 @@ EXEC sp_executesql @SqlStatement
|
||||||
`
|
`
|
||||||
|
|
||||||
const sqlServerSchedulers string = `
|
const sqlServerSchedulers string = `
|
||||||
|
SET DEADLOCK_PRIORITY -10;
|
||||||
IF SERVERPROPERTY('EngineEdition') NOT IN (2,3,4) BEGIN /*NOT IN Standard,Enterpris,Express*/
|
IF SERVERPROPERTY('EngineEdition') NOT IN (2,3,4) BEGIN /*NOT IN Standard,Enterpris,Express*/
|
||||||
DECLARE @ErrorMessage AS nvarchar(500) = 'Telegraf - Connection string Server:'+ @@ServerName + ',Database:' + DB_NAME() +' is not a SQL Server Standard,Enterprise or Express. Check the database_type parameter in the telegraf configuration.';
|
DECLARE @ErrorMessage AS nvarchar(500) = 'Telegraf - Connection string Server:'+ @@ServerName + ',Database:' + DB_NAME() +' is not a SQL Server Standard,Enterprise or Express. Check the database_type parameter in the telegraf configuration.';
|
||||||
RAISERROR (@ErrorMessage,11,1)
|
RAISERROR (@ErrorMessage,11,1)
|
||||||
|
|
@ -459,6 +462,7 @@ OPTION(RECOMPILE)
|
||||||
`
|
`
|
||||||
|
|
||||||
const sqlServerWaitStatsCategorized string = `
|
const sqlServerWaitStatsCategorized string = `
|
||||||
|
SET DEADLOCK_PRIORITY -10;
|
||||||
IF SERVERPROPERTY('EngineEdition') NOT IN (2,3,4) BEGIN /*NOT IN Standard,Enterpris,Express*/
|
IF SERVERPROPERTY('EngineEdition') NOT IN (2,3,4) BEGIN /*NOT IN Standard,Enterpris,Express*/
|
||||||
DECLARE @ErrorMessage AS nvarchar(500) = 'Telegraf - Connection string Server:'+ @@ServerName + ',Database:' + DB_NAME() +' is not a SQL Server Standard,Enterprise or Express. Check the database_type parameter in the telegraf configuration.';
|
DECLARE @ErrorMessage AS nvarchar(500) = 'Telegraf - Connection string Server:'+ @@ServerName + ',Database:' + DB_NAME() +' is not a SQL Server Standard,Enterprise or Express. Check the database_type parameter in the telegraf configuration.';
|
||||||
RAISERROR (@ErrorMessage,11,1)
|
RAISERROR (@ErrorMessage,11,1)
|
||||||
|
|
@ -1025,6 +1029,7 @@ WHERE
|
||||||
`
|
`
|
||||||
|
|
||||||
const sqlServerRequests string = `
|
const sqlServerRequests string = `
|
||||||
|
SET DEADLOCK_PRIORITY -10;
|
||||||
IF SERVERPROPERTY('EngineEdition') NOT IN (2,3,4) BEGIN /*NOT IN Standard,Enterpris,Express*/
|
IF SERVERPROPERTY('EngineEdition') NOT IN (2,3,4) BEGIN /*NOT IN Standard,Enterpris,Express*/
|
||||||
DECLARE @ErrorMessage AS nvarchar(500) = 'Telegraf - Connection string Server:'+ @@ServerName + ',Database:' + DB_NAME() +' is not a SQL Server Standard,Enterprise or Express. Check the database_type parameter in the telegraf configuration.';
|
DECLARE @ErrorMessage AS nvarchar(500) = 'Telegraf - Connection string Server:'+ @@ServerName + ',Database:' + DB_NAME() +' is not a SQL Server Standard,Enterprise or Express. Check the database_type parameter in the telegraf configuration.';
|
||||||
RAISERROR (@ErrorMessage,11,1)
|
RAISERROR (@ErrorMessage,11,1)
|
||||||
|
|
@ -1127,6 +1132,7 @@ EXEC sp_executesql @SqlStatement
|
||||||
`
|
`
|
||||||
|
|
||||||
const sqlServerVolumeSpace string = `
|
const sqlServerVolumeSpace string = `
|
||||||
|
SET DEADLOCK_PRIORITY -10;
|
||||||
IF SERVERPROPERTY('EngineEdition') NOT IN (2,3,4) BEGIN /*NOT IN Standard,Enterpris,Express*/
|
IF SERVERPROPERTY('EngineEdition') NOT IN (2,3,4) BEGIN /*NOT IN Standard,Enterpris,Express*/
|
||||||
DECLARE @ErrorMessage AS nvarchar(500) = 'Telegraf - Connection string Server:'+ @@ServerName + ',Database:' + DB_NAME() +' is not a SQL Server Standard,Enterprise or Express. Check the database_type parameter in the telegraf configuration.';
|
DECLARE @ErrorMessage AS nvarchar(500) = 'Telegraf - Connection string Server:'+ @@ServerName + ',Database:' + DB_NAME() +' is not a SQL Server Standard,Enterprise or Express. Check the database_type parameter in the telegraf configuration.';
|
||||||
RAISERROR (@ErrorMessage,11,1)
|
RAISERROR (@ErrorMessage,11,1)
|
||||||
|
|
@ -1152,6 +1158,7 @@ END
|
||||||
`
|
`
|
||||||
|
|
||||||
const sqlServerRingBufferCPU string = `
|
const sqlServerRingBufferCPU string = `
|
||||||
|
SET DEADLOCK_PRIORITY -10;
|
||||||
IF SERVERPROPERTY('EngineEdition') NOT IN (2,3,4) BEGIN /*NOT IN Standard,Enterpris,Express*/
|
IF SERVERPROPERTY('EngineEdition') NOT IN (2,3,4) BEGIN /*NOT IN Standard,Enterpris,Express*/
|
||||||
DECLARE @ErrorMessage AS nvarchar(500) = 'Telegraf - Connection string Server:'+ @@ServerName + ',Database:' + DB_NAME() +' is not a SQL Server Standard,Enterprise or Express. Check the database_type parameter in the telegraf configuration.';
|
DECLARE @ErrorMessage AS nvarchar(500) = 'Telegraf - Connection string Server:'+ @@ServerName + ',Database:' + DB_NAME() +' is not a SQL Server Standard,Enterprise or Express. Check the database_type parameter in the telegraf configuration.';
|
||||||
RAISERROR (@ErrorMessage,11,1)
|
RAISERROR (@ErrorMessage,11,1)
|
||||||
|
|
@ -1214,6 +1221,7 @@ FROM (
|
||||||
// Collects availability replica state information from `sys.dm_hadr_availability_replica_states` for a High Availability / Disaster Recovery (HADR) setup
|
// Collects availability replica state information from `sys.dm_hadr_availability_replica_states` for a High Availability / Disaster Recovery (HADR) setup
|
||||||
// Certain fields are only supported on SQL Server 2016 and newer version, identified by check MajorMinorVersion >= 1300
|
// Certain fields are only supported on SQL Server 2016 and newer version, identified by check MajorMinorVersion >= 1300
|
||||||
const sqlServerAvailabilityReplicaStates string = `
|
const sqlServerAvailabilityReplicaStates string = `
|
||||||
|
SET DEADLOCK_PRIORITY -10;
|
||||||
IF SERVERPROPERTY('EngineEdition') NOT IN (2,3,4) BEGIN /*NOT IN Standard,Enterpris,Express*/
|
IF SERVERPROPERTY('EngineEdition') NOT IN (2,3,4) BEGIN /*NOT IN Standard,Enterpris,Express*/
|
||||||
DECLARE @ErrorMessage AS nvarchar(500) = 'Telegraf - Connection string Server:'+ @@ServerName + ',Database:' + DB_NAME() +' is not a SQL Server Standard,Enterprise or Express. Check the database_type parameter in the telegraf configuration.';
|
DECLARE @ErrorMessage AS nvarchar(500) = 'Telegraf - Connection string Server:'+ @@ServerName + ',Database:' + DB_NAME() +' is not a SQL Server Standard,Enterprise or Express. Check the database_type parameter in the telegraf configuration.';
|
||||||
RAISERROR (@ErrorMessage,11,1)
|
RAISERROR (@ErrorMessage,11,1)
|
||||||
|
|
@ -1280,6 +1288,7 @@ EXEC sp_executesql @SqlStatement
|
||||||
// Collects database replica state information from `sys.dm_hadr_database_replica_states` for a High Availability / Disaster Recovery (HADR) setup
|
// Collects database replica state information from `sys.dm_hadr_database_replica_states` for a High Availability / Disaster Recovery (HADR) setup
|
||||||
// Certain fields are only supported on SQL Server 2016 and newer version, or SQL Server 2014 and newer, identified by check MajorMinorVersion >= 1300 or MajorMinorVersion >= 1200
|
// Certain fields are only supported on SQL Server 2016 and newer version, or SQL Server 2014 and newer, identified by check MajorMinorVersion >= 1300 or MajorMinorVersion >= 1200
|
||||||
const sqlServerDatabaseReplicaStates string = `
|
const sqlServerDatabaseReplicaStates string = `
|
||||||
|
SET DEADLOCK_PRIORITY -10;
|
||||||
IF SERVERPROPERTY('EngineEdition') NOT IN (2,3,4) BEGIN /*NOT IN Standard,Enterpris,Express*/
|
IF SERVERPROPERTY('EngineEdition') NOT IN (2,3,4) BEGIN /*NOT IN Standard,Enterpris,Express*/
|
||||||
DECLARE @ErrorMessage AS nvarchar(500) = 'Telegraf - Connection string Server:'+ @@ServerName + ',Database:' + DB_NAME() +' is not a SQL Server Standard,Enterprise or Express. Check the database_type parameter in the telegraf configuration.';
|
DECLARE @ErrorMessage AS nvarchar(500) = 'Telegraf - Connection string Server:'+ @@ServerName + ',Database:' + DB_NAME() +' is not a SQL Server Standard,Enterprise or Express. Check the database_type parameter in the telegraf configuration.';
|
||||||
RAISERROR (@ErrorMessage,11,1)
|
RAISERROR (@ErrorMessage,11,1)
|
||||||
|
|
@ -1340,6 +1349,7 @@ EXEC sp_executesql @SqlStatement
|
||||||
`
|
`
|
||||||
|
|
||||||
const sqlServerRecentBackups string = `
|
const sqlServerRecentBackups string = `
|
||||||
|
SET DEADLOCK_PRIORITY -10;
|
||||||
IF SERVERPROPERTY('EngineEdition') NOT IN (2,3,4) BEGIN /*NOT IN Standard,Enterpris,Express*/
|
IF SERVERPROPERTY('EngineEdition') NOT IN (2,3,4) BEGIN /*NOT IN Standard,Enterpris,Express*/
|
||||||
DECLARE @ErrorMessage AS nvarchar(500) = 'Telegraf - Connection string Server:'+ @@ServerName + ',Database:' + DB_NAME() +' is not a SQL Server Standard,Enterprise or Express. Check the database_type parameter in the telegraf configuration.';
|
DECLARE @ErrorMessage AS nvarchar(500) = 'Telegraf - Connection string Server:'+ @@ServerName + ',Database:' + DB_NAME() +' is not a SQL Server Standard,Enterprise or Express. Check the database_type parameter in the telegraf configuration.';
|
||||||
RAISERROR (@ErrorMessage,11,1)
|
RAISERROR (@ErrorMessage,11,1)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue