Zabbix Mssql Failed To Fetch Info Data -or No Data For 30m- 100%

The "Failed to fetch info data" or "no data for 30m" error in Zabbix for MSSQL typically indicates a connectivity or permission issue between your Zabbix server/proxy and the SQL instance. 🛠️ Quick Troubleshooting Checklist

Verify ODBC Connectivity: Log in to your Zabbix server and run a manual test using isql:isql -v

Check User Permissions: Ensure the monitoring user has VIEW SERVER STATE and VIEW ANY DEFINITION permissions.

ODBC Driver Config: Ensure the driver name in /etc/odbcinst.ini matches exactly what is defined in your /etc/odbc.ini DSN.

Port Mapping: MSSQL named instances often use dynamic ports. Ensure your DSN or macro includes the correct port (e.g., Server = 192.168.1.1,1433). 1. Fix Connection & Driver Issues

The most common culprit is a broken ODBC path. If you recently updated your Zabbix server, the driver version might have changed.

Trust Certificate: If using ODBC Driver 18, you may need to add TrustServerCertificate=yes to your connection string in /etc/odbc.ini to handle self-signed SSL.

DSN Case Sensitivity: The DSN name in your Zabbix macro $MSSQL.DSN must exactly match the header in your odbc.ini file.

Poller Capacity: If multiple MSSQL hosts are failing, increase the number of ODBC pollers in your zabbix_server.conf by setting StartODBCPollers=5 (or higher) and restarting the service. 2. Verify SQL Permissions

Run this script on your SQL Server to ensure the Zabbix user has the minimum required access: zabbix mssql failed to fetch info data -or no data for 30m-

USE master; GRANT VIEW SERVER STATE TO [zabbix_user]; GRANT VIEW ANY DEFINITION TO [zabbix_user]; USE msdb; GRANT SELECT ON sysjobs TO [zabbix_user]; GRANT SELECT ON sysjobservers TO [zabbix_user]; GRANT SELECT ON sysjobactivity TO [zabbix_user]; ``` ### 3. Check Zabbix Macros Ensure the following **Macros** are set correctly on the Host level in the Zabbix frontend: * `$MSSQL.DSN`: The name used in your Linux `odbc.ini`. * `$MSSQL.USER` / `$MSSQL.PASSWORD`: Valid SQL credentials (note: some drivers fail if these contain special characters like `@` or `$`). 💡 **Pro Tip:** Check the **Zabbix Server logs** (`tail -f /var/log/zabbix/zabbix_server.log`) while the error is active. It will often give you the specific ODBC error code, such as `[08001]` for network issues or `[28000]` for login failures. --- If you'd like, let me know: * Which **Zabbix version** are you using? * Are you using the **ODBC template** or **Agent 2**? * What **OS** is your Zabbix server running on? I can help you pinpoint the exact configuration file line to change. Use code with caution. Copied to clipboard Zabbix 7.0 MSSQL ODBC Connection

Using the same DSN, username and password as the isql test fails in Zabbix with the following error: Cannot connect to ODBC DSN: [

Problem: MSSQL: Failed to fetch info data (or no data for 30m)

The error "MSSQL: Failed to fetch info data (or no data for 30m)" is a common trigger in Zabbix templates, typically indicating that the Zabbix Agent 2 or ODBC poller is unable to communicate with your Microsoft SQL Server instance. This guide covers how to resolve this for both Zabbix Agent 2 and ODBC setups. 1. Verify Authentication and Macros

The most frequent cause is a simple credential mismatch. Ensure your Host Macros are correctly set: $MSSQL.USER: The SQL login name. $MSSQL.PASSWORD: The corresponding password.

$MSSQL.URI: For Agent 2, use sqlserver://: (default port is 1433).

$MSSQL.DSN: For ODBC, this must match the name defined in your /etc/odbc.ini file. 2. Check Database Permissions

The Zabbix monitoring user requires specific permissions to pull performance data. If these are missing, the "fetch info data" item will fail. For MSSQL 2022:

GRANT VIEW SERVER PERFORMANCE STATE TO zabbix; GRANT VIEW ANY DEFINITION TO zabbix; Use code with caution. %%MAGIT_PARSER_PROTECT%% ``` The "Failed to fetch info data" or "no

For MSSQL 2017/2019:%%MAGIT_PARSER_PROTECT%% sql GRANT VIEW SERVER STATE TO zabbix; GRANT VIEW ANY DEFINITION TO zabbix; %%MAGIT_PARSER_PROTECT%%

System Job Access: Zabbix needs to read from the msdb database for job status:%%MAGIT_PARSER_PROTECT%% sql USE msdb; GRANT SELECT ON dbo.sysjobs TO zabbix; GRANT SELECT ON dbo.sysjobservers TO zabbix; GRANT SELECT ON dbo.sysjobactivity TO zabbix; GRANT EXECUTE ON dbo.agent_datetime TO zabbix; %%MAGIT_PARSER_PROTECT%% 3. Agent 2 Plugin Configuration

If you are using the MSSQL by Zabbix agent 2 template, the MSSQL plugin must be active and configured on the target host. Microsoft SQL monitoring and integration with Zabbix

3.1 Authentication & Permissions (Failed to fetch info data)

Step 3: Verify MSSQL Configuration

  1. SQL Server Agent: Ensure that the SQL Server Agent is running and set to start automatically.
  2. SQL Server Configuration: Verify that the SQL Server is configured to allow remote connections.
  3. Permissions: Verify that the Zabbix monitoring account has the necessary permissions to access the MSSQL database.

Step 1: Check the SQL Server Service Status

Before diving into logs and permissions, verify the basics.

  1. Log into the SQL Server host.
  2. Open Services.msc.
  3. Ensure the SQL Server (MSSQLSERVER) instance is running.

If the service is stopped, Zabbix obviously cannot fetch data. Start it and check the logs for why it stopped (usually memory pressure or disk errors).


Case 2: The Azure SQL Managed Instance

Symptom: “Failed to fetch info data” immediately.

Root cause: Azure SQL Managed Instance does not support sys.dm_os_performance_counters – it raises “Invalid object name”.

Solution: Switch to sys.dm_db_resource_stats or sys.server_resource_stats views. Customize the user parameter to query these instead. The official Zabbix template for Azure SQL Database is different from on-prem MSSQL.


“Failed to fetch info data”

This error appears in the Zabbix Server logs or Item configuration preview. It means the Zabbix agent (or proxy) executed an item key—typically perf_instance["MSSQL$INSTANCE",...] or a custom UserParameter—and the SQL query returned no valid result set, a permissions error, or a malformed response. SQL Login failure – Zabbix user lacks CONNECT

Common triggers:

Fix B: Use the Official Zabbix Template – Correctly

The Template DB MSSQL by ODBC (shipped with Zabbix 6.0+) is robust when properly configured.

  1. On the host macro level, set:

    • $MSSQL.DSN = ZabbixSQL (name of System DSN)
    • $MSSQL.USER = zabbix_svc (SQL login)
    • $MSSQL.PASSWORD = *****
    • $MSSQL.INSTANCE = MSSQLSERVER or localhost\INSTANCE
  2. Ensure the DSN uses Windows Authentication if you want to avoid storing passwords. Then leave $MSSQL.USER empty.

Step 4: Check Zabbix Agent

  1. Zabbix agent status: Check the status of the Zabbix agent on the MSSQL server using the command:
systemctl status zabbix-agent

(or service zabbix-agent status on older systems)

  1. Zabbix agent logs: Check the Zabbix agent logs for any errors or issues.

Fix C: Work Around the “No Data for 30m” Trigger

Edit the problematic trigger. For example, the default “MSSQL has not provided any data for 30 minutes” trigger might be:

nodata(/YourHost/perf_instance["SQLServer:Databases(_Total)\Data File(s) Size (KB)",_Total],30m)=1

Change to:

nodata(/YourHost/perf_instance["SQLServer:Databases(_Total)\Data File(s) Size (KB)",_Total],30m)=1 and last(/YourHost/perf_instance[...])<>0

Or increase the time to 2 hours and rely on other liveness checks.