How to Monitor Microsoft SQL Server (MSSQL) with Nagios XI

Picture of Ayub Huruse
Ayub Huruse
Microsoft SQL servers

Microsoft SQL Server (MSSQL) is the backbone of many critical applications, making proactive monitoring essential for optimal performance, high availability, and overall system health. With Nagios XI, you can effortlessly keep an eye on database status, query performance, and server metrics using its dedicated monitoring wizards. Whether you’re preventing downtime or optimizing performance, this guide will walk you through the step-by-step process of configuring Nagios XI to monitor your MSSQL environment effectively.

Prerequisites

Before diving into the configuration, ensure the following are in place:

  • SQL Server Authentication: Create a dedicated monitoring user account in MSSQL with appropriate permissions.
  • Firewall Rules: Configure the Windows firewall to allow inbound traffic on MSSQL ports.
  • Instance and Port Configuration: For named instances, verify that the SQL Server Browser service is running and accessible.

Setting Up the Monitoring User Account

A dedicated user account is needed for monitoring MSSQL:

  1. Open SQL Server Management Studio (SSMS) and connect with administrative rights.
  2. Navigate to Security > Logins and right-click New Login.
  3. Choose the authentication method:
    • Windows Authentication: Use an existing Windows account.
    • SQL Authentication: Create a new SQL user with a strong password.
  4. Grant the necessary permissions by executing this SQL query:
GRANT VIEW SERVER STATE TO [username];

5. Assign the user to the specific databases you intend to monitor (e.g., via the User Mapping tab in SSMS).

Configuring Firewall Rules

If the Windows firewall is enabled, configure the following:

  1. Open Windows Firewall with Advanced Security.
  2. Create a new Inbound Rule:
    • Port Type: TCP
    • Port Number: 1433 (default) or your custom MSSQL port
  3. For named instances, add a second rule:
    • Port Type: UDP
    • Port Number: 1434 (for SQL Server Browser)
  4. Apply the rules and restart the SQL Server service if changes were made to port settings.

Running the MSSQL Configuration Wizard in Nagios XI

Nagios XI streamlines MSSQL monitoring with its intuitive configuration wizards. Follow these steps:

Step 1: Launch the Wizard

1. Navigate to Configure > Configuration Wizards in Nagios XI.

2. Search for and select the MSSQL Server wizard (or related options like MSSQL Database or MSSQL Query, depending on your needs).

Screenshot 2025 03 05 074054
Example output of MSSQL Server wizard

3. Enter the following details:

  • Address: IP address or hostname of the MSSQL server.
  • Host Name: A descriptive name for the server in Nagios (e.g., “MSSQL-Prod”).
  • Username: The monitoring user created earlier.
  • Password: The user’s password (confirm it matches).
  • Database Server Instance: Enter the instance name (e.g., “SQLEXPRESS”) if applicable.
  • Port: Specify the port (default: 1433) if using a static configuration.
  • MSSQL Version: Select the appropriate version (e.g., 2019, 2022).
  • TDS Version: Leave as “Auto” unless specific compatibility is required.

5. Click Next to continue.

Screenshot 2025 03 05 074023
Example output of MSSQL Server Config step 1

Step 2: Define Monitoring Parameters

  1. Ensure the Host Name field correctly identifies your MSSQL server.
  2. Select the metrics to monitor:
    • CPU and memory usage
    • Active connections
    • Database availability
    • Query performance
  3. Set Warning and Critical thresholds for alerts.
  4. Click Next to proceed.

Step 3-5: Finalizing the Setup

  1. Review your settings and apply any necessary changes.
  2. Click Finish to complete the wizard.
  3. After configuration, click View status details to check the newly created services.

Troubleshooting

If issues arise, consider the following steps:

  • Authentication Issues: Ensure the correct credentials are being used.
  • Firewall Blocks: Temporarily disable the firewall to confirm connectivity.
  • SQL Server Browser: Ensure it is running if connecting using an instance name.
  • Network Configuration: Check if the MSSQL server allows remote connections.

Conclusion

Nagios XI makes MSSQL monitoring straightforward and effective, delivering actionable insights into performance and availability. For additional assistance, consult the Nagios Support Forum or the Nagios Knowledgebase. Properly configured, this setup ensures your MSSQL environment remains reliable and optimized.

Share: