nri-mssql

module
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 14, 2018 License: MIT

README

New Relic Infrastructure Integration for Microsoft SQL Server

The New Relic Infrastructure Integration for MS SQL Server captures critical performance metrics and inventory reported by a SQL Server Instance. Data on the SQL Server Instance and Databases is collected.

Inventory and metric data is collected via SQL queries to the Instance.

Requirements

No additional requirements to monitor.

Configuration

A user with the necessary permissions to collect all the metrics and inventory can be configured as follows

USE master;
CREATE LOGIN newrelic WITH PASSWORD = 'tmppassword';
CREATE USER newrelic FOR LOGIN newrelic;
GRANT CONNECT SQL TO newrelic;
GRANT VIEW SERVER STATE TO newrelic;

-- Goes through each user database and adds public permissions
DECLARE @name NVARCHAR(max)
DECLARE db_cursor CURSOR FOR
SELECT NAME
FROM master.dbo.sysdatabases
WHERE NAME NOT IN ('master','msdb','tempdb','model')
OPEN db_cursor
FETCH NEXT FROM db_cursor INTO @name WHILE @@FETCH_STATUS = 0
BEGIN
	EXECUTE('USE "' + @name + '"; CREATE USER newrelic FOR LOGIN newrelic;' );
	FETCH next FROM db_cursor INTO @name
END
CLOSE db_cursor
DEALLOCATE db_cursor

Installation

  • download an archive file for the MSSQL Integration
  • extract mssql-definition.yml and /bin directory into /var/db/newrelic-infra/newrelic-integrations
  • add execute permissions for the binary file nr-mssql (if required)
  • extract mssql-config.yml.sample into /etc/newrelic-infra/integrations.d

Usage

This is the description about how to run the MSSQL Integration with New Relic Infrastructure agent, so it is required to have the agent installed (see agent installation).

In order to use the MSSQL Integration it is required to configure mssql-config.yml.sample file. Firstly, rename the file to mssql-config.yml. Then, depending on your needs, specify all instances that you want to monitor. Once this is done, restart the Infrastructure agent.

You can view your data in Insights by creating your own custom NRQL queries. To do so use the MssqlDatabaseSample, MssqlInstanceSample event type.

Compatibility

  • Supported OS: No Limitations
  • MS SQL Server versions: SQL Server 2008 R2+

Integration Development usage

Assuming that you have source code you can build and run the MSSQL Integration locally.

  • Go to directory of the MSSQL Integration and build it
$ make
  • The command above will execute tests for the MSSQL Integration and build an executable file called nr-mssql in bin directory.
$ ./bin/nr-mssql
  • If you want to know more about usage of ./nr-mssql check
$ ./bin/nr-mssql -help

For managing external dependencies govendor tool is used. It is required to lock all external dependencies to specific version (if possible) into vendor directory.

Directories

Path Synopsis
src
args
Package args contains the argument list, defined as a struct, along with a method that validates passed-in args
Package args contains the argument list, defined as a struct, along with a method that validates passed-in args
connection
Package connection contains the SQLConnection type and methods for manipulating and querying the connection
Package connection contains the SQLConnection type and methods for manipulating and querying the connection
database
Package database contains helper methods for retrieving data about each database in the target environment
Package database contains helper methods for retrieving data about each database in the target environment
instance
Package instance contains helper methods for instance-level metric collection
Package instance contains helper methods for instance-level metric collection
inventory
Package inventory contains all the code used to collect inventory items from the target
Package inventory contains all the code used to collect inventory items from the target
metrics
Package metrics contains all the code that is used to collect metrics from the target
Package metrics contains all the code that is used to collect metrics from the target

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL