• /
  • EnglishEspañolFrançais日本語한국어Português
  • ログイン今すぐ開始

Linux self-hosted MSSQL monitoring with NRDOT

Preview

We're still working on this feature, but we'd love for you to try it out!

This feature is currently provided as part of a preview pursuant to our pre-release policies.

Set up Microsoft SQL Server monitoring using the NRDOT collector on Linux self-hosted environments including physical servers, virtual machines, and containerized Linux deployments.

Prerequisites

Ensure your environment meets our compatibility and prerequisites.

Set up the NRDOT Collector

Install the NRDOT Collector on your Linux flavour:

重要

It is recommended to install the NRDOT Collector on the same host as your SQL Server instance to view infrastructure-level metrics for query performance monitoring.

  1. Debian / Ubuntu

For AMD64 (x86_64) Architecture:

bash
$
NRDOT_VERSION=$(curl -s https://api.github.com/repos/newrelic/nrdot-collector-releases/releases/latest | grep '"tag_name":' | awk -F'"' '{print $4}') && curl -L "https://github.com/newrelic/nrdot-collector-releases/releases/download/${NRDOT_VERSION}/nrdot-collector_${NRDOT_VERSION}_linux_amd64.deb" --output nrdot-collector.deb && sudo dpkg -i nrdot-collector.deb

For ARM64 Architecture:

bash
$
NRDOT_VERSION=$(curl -s https://api.github.com/repos/newrelic/nrdot-collector-releases/releases/latest | grep '"tag_name":' | awk -F'"' '{print $4}') && curl -L "https://github.com/newrelic/nrdot-collector-releases/releases/download/${NRDOT_VERSION}/nrdot-collector_${NRDOT_VERSION}_linux_arm64.deb" --output nrdot-collector.deb && sudo dpkg -i nrdot-collector.deb
  1. RHEL / CentOS

For AMD64 (x86_64) Architecture:

bash
$
NRDOT_VERSION=$(curl -s https://api.github.com/repos/newrelic/nrdot-collector-releases/releases/latest | grep '"tag_name":' | awk -F'"' '{print $4}') && curl -L "https://github.com/newrelic/nrdot-collector-releases/releases/download/${NRDOT_VERSION}/nrdot-collector_${NRDOT_VERSION}_linux_x86_64.rpm" --output nrdot-collector.rpm && sudo rpm -ivh nrdot-collector.rpm

For ARM64 Architecture:

bash
$
NRDOT_VERSION=$(curl -s https://api.github.com/repos/newrelic/nrdot-collector-releases/releases/latest | grep '"tag_name":' | awk -F'"' '{print $4}') && curl -L "https://github.com/newrelic/nrdot-collector-releases/releases/download/${NRDOT_VERSION}/nrdot-collector_${NRDOT_VERSION}_linux_arm64.rpm" --output nrdot-collector.rpm && sudo rpm -ivh nrdot-collector.rpm

Configure database user

Run the following script as a root user/sysadmin to create the newrelic monitoring user and grant global read permissions.

  1. To create a newrelic monitoring user in Linux, create a file named nr-grant-permission.sql on your Linux instance with the following content:

    USE [master];
    GO
    CREATE LOGIN [newrelic] WITH PASSWORD = '<PASSWORD>';
    GO
    -- Instance-level permissions
    GRANT VIEW SERVER STATE TO [newrelic];
    GRANT VIEW ANY DEFINITION TO [newrelic];
    GRANT VIEW ANY DATABASE TO [newrelic];
    GO
    -- Grant read access privileges to all user databases
    DECLARE @name SYSNAME;
    DECLARE db_cursor CURSOR READ_ONLY FORWARD_ONLY FOR
    SELECT [name]
    FROM [master].[sys].[databases]
    WHERE [name] NOT IN ('master', 'msdb', 'model', 'rdsadmin', 'distribution')
    AND [state] = 0; -- Only online databases
    OPEN db_cursor;
    FETCH NEXT FROM db_cursor INTO @name;
    WHILE @@FETCH_STATUS = 0
    BEGIN
    BEGIN TRY
    EXEC('USE [' + @name + '];
    IF NOT EXISTS (SELECT 1 FROM sys.database_principals WHERE name = ''newrelic'')
    CREATE USER [newrelic] FOR LOGIN [newrelic];');
    END TRY
    BEGIN CATCH
    PRINT 'Error on ' + @name + ': ' + ERROR_MESSAGE();
    END CATCH
    FETCH NEXT FROM db_cursor INTO @name;
    END
    CLOSE db_cursor;
    DEALLOCATE db_cursor;
    GO
  2. To execute the script, run the following command. Replace <Your_SA_Password> with your SQL Server administrator password:

    bash
    $
    sqlcmd -S localhost -U sa -P '<Your_SA_Password>' -C -i nr-grant-permission.sql
  3. (Optional) To verify that the user was created successfully and has the correct permissions, run the following command. Replace <Your_SA_Password> with your SQL Server administrator password:

    bash
    $
    sqlcmd -S localhost -U sa -P '<Your_SA_Password>' -C -Q "SELECT sp.name AS [User], p.permission_name AS [Permission_Granted] FROM sys.server_permissions p JOIN sys.server_principals sp ON p.grantee_principal_id = sp.principal_id WHERE sp.name = 'newrelic';"

    Expected Output:

    User Permission_Granted
    -------------------------------------------------------------------------------------
    <your_username> CONNECT SQL
    <your_username> VIEW ANY DEFINITION
    <your_username> VIEW ANY DATABASE
    <your_username> VIEW SERVER STATE

This output confirms that your user has been created successfully with the required server-level permissions.

Configure NRDOT Collector

Select your configuration type based on your monitoring needs:

ヒント

Note: The max_concurrent_queries option controls how many metric queries the receiver executes in parallel against SQL Server during each scrape cycle.

receivers:
nrsqlserver:
max_concurrent_queries: 4 # default is 4 if omitted or set to 0

Configuration parameters

The following table describes the key configuration parameters for the nrsqlserver receiver:

ParameterDescription
<YOUR_USERNAME>Enter your database username for authentication
<YOUR_PASSWORD>Enter your database password for authentication
<YOUR_SERVER>Enter your SQL Server hostname or IP address
portEnter your SQL Server port number. The default value is 1433.
<YOUR_OTLP_ENDPOINT>Enter the New Relic OTLP endpoint. For more information, refer to New Relic OTLP endpoints documentation.
<YOUR_LICENSE_KEY>Enter your New Relic license key.
collection_intervalInterval in seconds to collect database metrics. Default: 15s

ヒント

Note: If you enable all available metrics, increase the limit_mib value (e.g., 1000) to prevent the memory limiter from dropping data.

  1. Update the collector configuration file

    Run the following command to edit the service configuration:

    bash
    $
    sudo nano /etc/nrdot-collector/nrdot-collector.conf

    Update the config path to point to your new mssql-config.yaml file:

    bash
    $
    OTELCOL_CONFIG="/etc/nrdot-collector/mssql-config.yaml"
  2. Validate NRDOT Collector Configuration

    Validate the NRDOT Collector configuration to ensure it's correctly formatted and will work properly:

    bash
    $
    sudo /usr/bin/nrdot-collector validate --config=/etc/nrdot-collector/mssql-config.yaml

Restart NRDOT collector

After updating your configuration, restart the NRDOT Collector service:

bash
$
sudo systemctl restart nrdot-collector

ヒント

Always restart the NRDOT collector service after making configuration changes to ensure the new settings take effect.

Next steps

After setting up Linux self-hosted monitoring:

Copyright © 2026 New Relic株式会社。

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.