|
1 | 1 | # New Relic Infrastructure Integration for Microsoft SQL Server |
2 | 2 |
|
3 | | -Reports status and metrics for nri-mssql service |
| 3 | +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. |
| 4 | + |
| 5 | +Inventory and metric data is collected via SQL queries to the Instance. |
4 | 6 |
|
5 | 7 | ## Requirements |
6 | 8 |
|
7 | | -Document if the Integration has some special requirement. Ex: Installing an |
8 | | -extra module, permissions to execute a binary, etc. |
| 9 | +No additional requirements to monitor. |
9 | 10 |
|
10 | 11 | ## Configuration |
11 | 12 |
|
12 | | -Document if the Integration needs some configuration for running. Ex: Set |
13 | | -up permissions, add a special user, etc. |
| 13 | +A user with the necessary permissions to collect all the metrics and inventory can be configured as follows |
| 14 | + |
| 15 | +``` |
| 16 | +USE master; |
| 17 | +CREATE LOGIN newrelic WITH PASSWORD = 'tmppassword'; |
| 18 | +CREATE USER newrelic FOR LOGIN newrelic; |
| 19 | +GRANT CONNECT SQL TO newrelic; |
| 20 | +GRANT VIEW SERVER STATE TO newrelic; |
| 21 | +
|
| 22 | +-- Goes through each user database and adds public permissions |
| 23 | +DECLARE @name NVARCHAR(max) |
| 24 | +DECLARE db_cursor CURSOR FOR |
| 25 | +SELECT NAME |
| 26 | +FROM master.dbo.sysdatabases |
| 27 | +WHERE NAME NOT IN ('master','msdb','tempdb','model') |
| 28 | +OPEN db_cursor |
| 29 | +FETCH NEXT FROM db_cursor INTO @name WHILE @@FETCH_STATUS = 0 |
| 30 | +BEGIN |
| 31 | + EXECUTE('USE "' + @name + '"; CREATE USER newrelic FOR LOGIN newrelic;' ); |
| 32 | + FETCH next FROM db_cursor INTO @name |
| 33 | +END |
| 34 | +CLOSE db_cursor |
| 35 | +DEALLOCATE db_cursor |
| 36 | +``` |
14 | 37 |
|
15 | 38 | ## Installation |
16 | 39 |
|
17 | | -Describe the installation process for the Integration. |
| 40 | +- download an archive file for the `MSSQL` Integration |
| 41 | +- extract `mssql-definition.yml` and `/bin` directory into `/var/db/newrelic-infra/newrelic-integrations` |
| 42 | +- add execute permissions for the binary file `nr-mssql` (if required) |
| 43 | +- extract `mssql-config.yml.sample` into `/etc/newrelic-infra/integrations.d` |
18 | 44 |
|
19 | 45 | ## Usage |
20 | 46 |
|
21 | | -Document mandatory and optional arguments for running the Integration, and how to execute it. |
| 47 | +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](https://docs.newrelic.com/docs/infrastructure/new-relic-infrastructure/installation/install-infrastructure-linux)). |
| 48 | + |
| 49 | +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. |
| 50 | + |
| 51 | +You can view your data in Insights by creating your own custom NRQL queries. To do so use the **MssqlDatabaseSample**, **MssqlInstanceSample** event type. |
22 | 52 |
|
23 | 53 | ## Compatibility |
24 | 54 |
|
25 | | -* Supported OS: |
26 | | -* nri-mssql versions: |
27 | | -* Edition: |
| 55 | +* Supported OS: No Limitations |
| 56 | +* MS SQL Server versions: SQL Server 2008 R2+ |
28 | 57 |
|
29 | 58 | ## Integration Development usage |
30 | 59 |
|
31 | | -Describe the development workflow for this Integration. |
| 60 | +Assuming that you have source code you can build and run the MSSQL Integration locally. |
| 61 | + |
| 62 | +* Go to directory of the MSSQL Integration and build it |
| 63 | +```bash |
| 64 | +$ make |
| 65 | +``` |
| 66 | +* The command above will execute tests for the MSSQL Integration and build an executable file called `nr-mssql` in `bin` directory. |
| 67 | +```bash |
| 68 | +$ ./bin/nr-mssql |
| 69 | +``` |
| 70 | +* If you want to know more about usage of `./nr-mssql` check |
| 71 | +```bash |
| 72 | +$ ./bin/nr-mssql -help |
| 73 | +``` |
| 74 | + |
| 75 | +For managing external dependencies [govendor tool](https://github.com/kardianos/govendor) is used. It is required to lock all external dependencies to specific version (if possible) into vendor directory. |
0 commit comments