Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Metricbeat][MSSQL] Docs clarifications for credentials and permissions #13006

Closed
kostasb opened this issue Jul 22, 2019 · 4 comments
Closed
Labels
docs Metricbeat Metricbeat Stalled Team:Integrations Label for the Integrations team

Comments

@kostasb
Copy link
Contributor

kostasb commented Jul 22, 2019

Docs enhancement requests for the MSSQL module.

  1. The default connection string in mssql.yml is
    hosts: ["sqlserver://sa@localhost"]
    The module's documentation could clarify that credentials can be passed along in the form of
    sqlserver://adminusername:adminpassword@hostname

  2. It would be useful to provide some SQL-side recommendations for the minimal permissions required for the configured database user to query the endpoints necessary for extracting the metricsets.

@kaiyan-sheng kaiyan-sheng added Team:Integrations Label for the Integrations team Metricbeat Metricbeat labels Jul 22, 2019
@rbudiraharjo
Copy link

You could also use:

hosts: ["sqlserver://localhost"]
username: user
password: pass

@andresrc
Copy link
Contributor

cf. #12267

@alekniknik
Copy link

Hi,

I was investigating permissions and you need next privileges:

use master
go
GRANT VIEW SERVER STATE TO [databaseuser]
GO

and public permision for all user database on server you can run this script or manuel exec this for all database create user [databaseuser] for login [databaseuser];
use master
go
DECLARE @dbname VARCHAR(50)
DECLARE @Statement NVARCHAR(max)
DECLARE db_cursor CURSOR
LOCAL FAST_FORWARD
FOR
SELECT name
FROM MASTER.dbo.sysdatabases
WHERE name NOT IN ('master','model','msdb','tempdb','distribution')
OPEN db_cursor
FETCH NEXT FROM db_cursor INTO @dbname
WHILE @@FETCH_STATUS = 0
BEGIN

SELECT @Statement = 'use '+@dbname +';'+ 'CREATE USER [databaseuser]
FOR LOGIN [databaseuser];'

exec sp_executesql @Statement

FETCH NEXT FROM db_cursor INTO @dbname
END
CLOSE db_cursor
DEALLOCATE db_cursor

This mssql module work on MSSQL 2017 in previous version some part is not working (sys.dm_db_log_stats not exist in prev version)

Best regards;

@andresrc andresrc added [zube]: Old-Inbox Team:Services (Deprecated) Label for the former Integrations-Services team [zube]: Inbox [zube]: Ready and removed candidate Candidate to be added to the current iteration [zube]: Old-Inbox [zube]: Inbox labels Jan 27, 2020
@masci masci removed Team:Services (Deprecated) Label for the former Integrations-Services team [zube]: Ready module labels Mar 4, 2021
@masci masci unassigned sayden Mar 4, 2021
@botelastic
Copy link

botelastic bot commented Mar 4, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Metricbeat Metricbeat Stalled Team:Integrations Label for the Integrations team
Projects
None yet
Development

No branches or pull requests

7 participants