Install Microsoft SQL Server collector

Telegraf comes with an integrated Microsoft SQL Server plugin to monitor and measure Microsoft SQL Server related metrics. Please read this section to setup the plugin.

Install Telegraf agent

see section Telegraf Agent

Create User to query SQL

Telegraf requires a user with view permission to the following objects:

You can create a user called telegraf and grant permissions with the following command. Please note to change the password:

GO
CREATE LOGIN telegraf WITH PASSWORD = 'secret';
GO
GRANT VIEW SERVER STATE TO telegraf;
GO
GRANT VIEW ANY DEFINITION TO telegraf;
GO

Telegraf configuration

Uncomment or set the following configuration parameters in the telegraf.confi file:

[[inputs.sqlserver]]

## Specify instances to monitor with a list of connection strings.
## All connection parameters are optional.
## By default, the host is localhost, listening on the default port, TCP 1433.
## for Windows, the user is the currently running AD user (SSO).
## See https://github.com/denisenkom/go-mssqldb for detailed connection
## parameters.

servers = [
  "Server=localhost;Port=1433;User Id=telegraf;Password=secret;app name=telegraf;log=1;",
]

Add Microsoft SQL Server

For every Microsoft SQL Server you need to add the following line in the section servers of the [[inputs.sqlserver]] telegraf configuration.

"Server=localhost;Port=1433;User Id=telegraf;Password=secret;app name=telegraf;log=1;",

Ajust the following parameters to your enviroment:

  • Server
  • Port
  • User Id
  • Password

Import Grafana Microsoft SQL Server dashboard

Import the newbIT Grafana dashboard for Microsoft SQL Server.

Filename: mssql_dashboard.json

Additional Information

Please read the plugin README for further information and supported configuration parameters.

results matching ""

    No results matching ""