Environment: Zabbix 6.4, MSSQL 2019, UnixODBC with FreeTDS.
Error: Every 3 hours, “Failed to fetch info data” for 5 minutes, then auto-recovered.
Diagnosis:
Fix: Increased QueryTimeout from 5 to 30 seconds in Zabbix item configuration and scheduled backup outside peak monitoring.
The Zabbix "Template DB MSSQL" relies heavily on PowerShell scripts and specific ODBC connections to extract performance and availability data. When the Zabbix frontend displays "No data for 30m" or the server log reports "Failed to fetch info data," it indicates a breakdown in the communication chain between the Zabbix Server/Proxy and the MSSQL instance.
This paper outlines the four primary failure points: Network/Timeouts, Authentication/Permissions, PowerShell Execution Policy, and ODBC Driver architecture mismatches.
This specific error usually originates from the Zabbix Agent 2 (which has native MSSQL plugin support) or a custom ODBC/UserParameter setup.
When Zabbix says "failed to fetch info data," it means the agent attempted to execute a query (likely against performance counters or DMVs) and received:
The second part of the trigger—"no data for 30m"—simply confirms that the item has stopped receiving data entirely, rather than just receiving a "zero" value.
Sometimes, SQL Server performance counters become corrupted or disabled. If Zabbix relies on WMI or performance counters directly, this will result in "no data."
Rebuild Counters (Run in CMD as Admin):
| Cause | Solution |
|-------|----------|
| ODBC timeout | Increase QueryTimeout in item → odbc.select[DSN,query,,30] (30 sec) |
| Zabbix server timeout | Set Timeout=10 in zabbix_server.conf (restart server) |
| Intermittent network | Deploy Zabbix proxy on same host as MSSQL. |
| Agent overload | Increase StartAgents and StartPollersUnreachable. | zabbix mssql failed to fetch info data -or no data for 30m-
The errors “Failed to fetch info data” and “No data for 30m” in Zabbix MSSQL monitoring are symptoms of distinct underlying issues. The former is often permission or query-related; the latter points to timeouts or connectivity loss. A systematic diagnostic approach—starting with log analysis, manual ODBC testing, and MSSQL session inspection—enables rapid resolution. Implementing Zabbix Agent 2 and fine-tuning timeouts significantly reduces recurrence, ensuring reliable database observability.
If you are not using the Agent 2 plugin but are using db.odbc.* items, your connection string might be broken.
The errors “Failed to fetch info data” and “No data for 30m” are not Zabbix bugs – they are symptoms of a broken contract between your monitoring tool and your database. By systematically checking ODBC drivers, service account permissions, instance names, and localization, you can restore full visibility.
Remember: No data is never acceptable for a production SQL Server. Use the diagnostics in this guide to enforce a 15-minute maximum data outage, and set up proactive alerts for the monitoring system itself.
After fixing the issue once, document the exact DSN, login permissions, and UserParameter overrides in your runbook. The next time SQL Server patches or a failover occurs, you’ll recover in minutes – not days.
Further Resources
Last updated: For Zabbix 6.4+ and SQL Server 2017-2022.
The "MSSQL: Failed to fetch info data (or no data for 30m)" alert in Zabbix is a common trigger indicating that the master item used to gather SQL Server metrics—either via Zabbix Agent 2 —is failing to return results Common Root Causes & Fixes Missing or Incorrect Permissions
: The monitoring user must have specific rights to view server state and access the . Use the following T-SQL to grant required permissions: GRANT VIEW SERVER STATE TO [zabbix_user] VIEW SERVER PERFORMANCE STATE for SQL 2022+) GRANT VIEW ANY DEFINITION TO [zabbix_user] Read access to msdb.dbo.sysjobs msdb.dbo.sysjobservers msdb.dbo.sysjobactivity Zabbix Git repository ODBC Configuration Issues (ODBC Template) Port Formatting
: Microsoft SQL Server typically uses a comma for the port (e.g., Server = 192.168.1.10,1433 ) rather than a colon Trust Server Certificate
: If you are using a self-signed certificate, you may need to add TrustServerCertificate=Yes or use the flag if testing with $MSSQL.USER $MSSQL.PASSWORD Environment: Zabbix 6
are set at the host level, as credentials stored directly in often fail to work with Zabbix Zabbix Git repository Zabbix Agent 2 Configuration Plugin Config Location mssql.conf
file is often placed in a subdirectory that Agent 2 doesn't read by default . Move it to the zabbix_agent2.d directory or ensure your zabbix_agent2.conf includes a path to it (e.g., Include=./zabbix_agent2.d/plugins.d/*.conf Restart Required
: Any change to the plugin configuration or the agent requires a full service restart to apply Encryption and Driver Version Modern drivers (like ODBC Driver 18) default to Encrypt=yes
. If your server isn't configured for it, connection attempts will fail Check for driver-specific errors in the Zabbix Server or Proxy logs
to identify network-related or instance-specific connection failures Troubleshooting Steps
Problem: MSSQL: Failed to fetch info data (or no data for 30m)
The error message "MSSQL: Failed to fetch info data (or no data for 30m)" typically indicates a communication failure between the Zabbix agent/server and the target SQL Server instance. This usually results from incorrect connection settings, missing ODBC drivers, or insufficient database permissions. Immediate Troubleshooting Steps
Check Connection Parameters: Verify that your macros or DSN settings are correct.
Server/Port: Ensure the address is set as ipaddress,1433 (use a comma instead of a colon for SQL Server ports).
Trust Certificate: If using newer ODBC drivers (v18+), encryption is often forced. Try adding TrustServerCertificate=yes or Encrypt=yes to your connection string or odbc.ini file.
Verify ODBC Driver Connectivity: Test the connection manually from the command line on the Zabbix server or proxy using isql or sqlcmd to rule out Zabbix-specific issues: isql -v Fix: Increased QueryTimeout from 5 to 30 seconds
Confirm Database Permissions: The monitoring user requires specific rights to fetch performance data. Run these commands on your SQL Server:
GRANT VIEW SERVER STATE TO zabbix; (or VIEW SERVER PERFORMANCE STATE for SQL 2022). GRANT VIEW ANY DEFINITION TO zabbix;.
Zabbix Agent 2 Plugin Configuration: If you are using the MSSQL by Zabbix agent 2 template, ensure the plugin configuration file (mssql.conf) is in the correct directory (typically zabbix_agent2.d/plugins.d/) and that the agent has been restarted. Common Fixes from the Community
Username/Password Storage: Users on the Zabbix Forum suggest passing credentials as arguments from the Zabbix frontend rather than storing them in odbc.ini.
Preprocessing Issues: Check if the template's JSONPath preprocessing is failing due to spaces in counter names. For example, change Buffercachehitratio to Buffer cache hit ratio if the raw data includes spaces.
Zabbix Agent 2 Sessions: In mssql.conf, define your connection sessions clearly: Plugins.MSSQL.Sessions..
Are you using the ODBC template or Zabbix Agent 2 for this monitoring setup?
Problem: MSSQL: Failed to fetch info data (or no data for 30m)
PiotrJ. Junior Member. Joined: May 2023. Posts: 26. Problem: MSSQL: Failed to fetch info data (or no data for 30m) 21-09-2023, 19:
MSSQL: Failed to fetch info data (or no data for 30m) - Zabbix
ybcnyc. Junior Member. Joined: Jun 2022. Posts: 1. MSSQL monitoring - MSSQL: Failed to fetch info data (or no data for 30m) 16-06-
MSSQL: Failed to fetch info data (or no data for 30m) - Zabbix
ybcnyc. Junior Member. Joined: Jun 2022. Posts: 1. MSSQL monitoring - MSSQL: Failed to fetch info data (or no data for 30m) 16-06- Microsoft SQL monitoring and integration with Zabbix