What are the user privileges required to monitor MsSql database server?
SQL user need to have the below roles
Queries to grant the privileges 1, 2, 3:
USE [master]
GO
CREATE LOGIN [<eg_user>] WITH PASSWORD=N'<eg_user_password>', DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
use [master]
GRANT CONNECT SQL TO [<eg_user>]
GRANT VIEW ANY DEFINITION TO [<eg_user>]
GRANT VIEW SERVER STATE TO [<eg_user>]
Queries to grant the privileges 4:
USE master
DECLARE @LoginName varchar(256)
SET @LoginName ='<eg_user>'
SELECT 'USE [' + Name + ']'
+ ';'
+ 'CREATE USER [' + @LoginName + '] FOR LOGIN [' + @LoginName + '] '
+ 'EXEC sp_addrolemember ''db_datareader'', '''+ @LoginName + ''''
AS ScriptToExecute
FROM sys.databases
WHERE (state_desc ='ONLINE')
AND (source_database_id Is Null)
ORDER BY Name
Queries to grant the privileges 5, 6:
USE [msdb]
CREATE USER [<eGUser>] FOR LOGIN [<eGUser>]
GRANT SELECT ON [dbo].[sysjobhistory] TO [<eGUser>]
GRANT SELECT ON [dbo].[sysjobs] TO [<eGUser>]
John Thomas
What are the user privileges required to monitor MsSql database server?
SQL user need to have the below roles
Queries to grant the privileges 1, 2, 3:
USE [master]
GO
CREATE LOGIN [<eg_user>] WITH PASSWORD=N'<eg_user_password>', DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
use [master]
GO
GRANT CONNECT SQL TO [<eg_user>]
GO
use [master]
GO
GRANT VIEW ANY DEFINITION TO [<eg_user>]
GO
use [master]
GO
GRANT VIEW SERVER STATE TO [<eg_user>]
GO
Queries to grant the privileges 4:
USE master
GO
DECLARE @LoginName varchar(256)
SET @LoginName ='<eg_user>'
SELECT 'USE [' + Name + ']'
+ ';'
+ 'CREATE USER [' + @LoginName + '] FOR LOGIN [' + @LoginName + '] '
+ ';'
+ 'EXEC sp_addrolemember ''db_datareader'', '''+ @LoginName + ''''
AS ScriptToExecute
FROM sys.databases
WHERE (state_desc ='ONLINE')
AND (source_database_id Is Null)
ORDER BY Name
Queries to grant the privileges 5, 6:
USE [msdb]
GO
CREATE USER [<eGUser>] FOR LOGIN [<eGUser>]
GO
GRANT SELECT ON [dbo].[sysjobhistory] TO [<eGUser>]
GO
GRANT SELECT ON [dbo].[sysjobs] TO [<eGUser>]
GO
Administrator
SQL user need to have the below roles
Queries to grant the privileges 1, 2, 3:
USE [master]
GO
CREATE LOGIN [<eg_user>] WITH PASSWORD=N'<eg_user_password>', DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF
GO
use [master]
GO
GRANT CONNECT SQL TO [<eg_user>]
GO
use [master]
GO
GRANT VIEW ANY DEFINITION TO [<eg_user>]
GO
use [master]
GO
GRANT VIEW SERVER STATE TO [<eg_user>]
GO
Queries to grant the privileges 4:
USE master
GO
DECLARE @LoginName varchar(256)
SET @LoginName ='<eg_user>'
SELECT 'USE [' + Name + ']'
+ ';'
+ 'CREATE USER [' + @LoginName + '] FOR LOGIN [' + @LoginName + '] '
+ ';'
+ 'EXEC sp_addrolemember ''db_datareader'', '''+ @LoginName + ''''
AS ScriptToExecute
FROM sys.databases
WHERE (state_desc ='ONLINE')
AND (source_database_id Is Null)
ORDER BY Name
Queries to grant the privileges 5, 6:
USE [msdb]
GO
CREATE USER [<eGUser>] FOR LOGIN [<eGUser>]
GO
GRANT SELECT ON [dbo].[sysjobhistory] TO [<eGUser>]
GO
GRANT SELECT ON [dbo].[sysjobs] TO [<eGUser>]
GO
-
Finding eG Agent version
-
Delete and Acknowledge alarms
-
Updating nick names
-
Changing IP address of a monitored component
-
Changing IP address of remote agent and external agent
-
Inside view metrics are not collected by eG
-
Error 1067
-
Agent stopped running
-
eG agent auto-startup
-
Remote agent connection issue
See all 77 topics