Zabbix Mssql Failed To Fetch Info Data -or No Data For 30m- Online
Performance counters are fragile (localization, missing objects). For critical metrics, use db.odbc.select with custom T-SQL.
Example UserParameter in zabbix_agentd.conf:
UserParameter=mssql.connections,echo "SELECT cntr_value FROM sys.dm_os_performance_counters WHERE object_name='SQLServer:General Statistics' AND counter_name='User Connections'" | tsql -S localhost -U zabbix -P pass -D master -o /tmp/out -q
Or better (Windows):
UserParameter=mssql.connections,powershell -Command "& $conn=New-Object Data.Odbc.OdbcConnection('DSN=ZabbixSQL');$conn.Open();$cmd=$conn.CreateCommand();$cmd.CommandText='SELECT cntr_value FROM sys.dm_os_performance_counters WHERE object_name=''SQLServer:General Statistics'' AND counter_name=''User Connections''';$cmd.ExecuteScalar();$conn.Close() "
Conclusion
Troubleshooting Zabbix MSSQL monitoring issues requires a systematic approach to identify and resolve the underlying causes. By following these steps, you should be able to identify and resolve the issues causing the "failed to fetch info data" or "no data for 30m" errors.
Paper References
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
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 zabbix mssql failed to fetch info data -or no data for 30m-
: 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)
"MSSQL: Failed to fetch info data (or no data for 30m)" typically indicates a communication or permission breakdown between Zabbix and your SQL Server
. This usually occurs when using the "MSSQL by ODBC" or "MSSQL by Zabbix agent 2" templates. Common Solutions Trust Server Certificate (ODBC Driver 18+)
: If you recently upgraded to ODBC Driver 18, it forces encryption by default. If your SQL Server uses a self-signed certificate, you must add TrustServerCertificate=yes to your connection string or the file. Some users found reverting to ODBC Driver 17
resolved the issue immediately as it is more compatible with older configurations. Database Permissions
: Ensure the Zabbix monitoring user has the following permissions on the MSSQL instance: VIEW SERVER STATE (for 2017/2019) or VIEW SERVER PERFORMANCE STATE (for 2022). VIEW ANY DEFINITION Access to the database for job monitoring. Correct Connection Syntax
or Zabbix macros, the port must be specified after a comma, not a colon (e.g., Server = 192.168.1.50,1433 as a separate directive often fails. Macro Configuration : Verify that your host macros are correctly set: $MSSQL.USER $MSSQL.PASSWORD $MSSQL.DSN (must match the name in your /etc/odbc.ini on the Zabbix server/proxy). Agent 2 Configuration
: If using the Zabbix Agent 2 plugin, ensure you have configured the mssql.conf file (located in zabbix_agent2.d/plugins.d/ ) with the correct URI, username, and password. Diagnostic Steps Or better (Windows): UserParameter=mssql
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-
Problem: MSSQL: Failed to fetch info data (or no data for 30m)
When Zabbix fails to fetch MSSQL info data for 30 minutes, it typically indicates a configuration gap between the Zabbix Agent 2 and the MSSQL plugin. Key Solution: Configure MSSQL Plugin Sessions
The most effective way to resolve this "no data" error is to use Named Sessions in your configuration. This bypasses common connection issues by explicitly defining the URI and credentials in the plugin configuration.
Locate the Plugin Config: Open mssql.conf, typically found in /etc/zabbix/zabbix_agent2.d/plugins.d/ (Linux) or the agent's install directory (Windows).
Add a Session: Define a session name (e.g., SQLServer1) and its connection details:
Plugins.MSSQL.Sessions.SQLServer1.Uri=sqlserver:// Plugins.MSSQL.Sessions.SQLServer1.User=zbx_monitor Plugins.MSSQL.Sessions.SQLServer1.Password=
Update Zabbix Frontend: On your MSSQL Host in the Zabbix UI, update the following Macros: $MSSQL.USER: zbx_monitor $MSSQL.PASSWORD:
$MSSQL.DSN: SQLServer1 (matching the session name in your config).
Restart Agent: Restart the Zabbix Agent 2 service to apply these changes. Common Troubleshooting Steps not network connectivity.
ODBC Driver Requirements: Ensure you have the Microsoft ODBC Driver (version 17 or 18) installed on the Zabbix server or proxy, as it is required even when using Agent 2.
Permissions: The monitoring user must have VIEW SERVER STATE (for SQL 2017/2019) or VIEW SERVER PERFORMANCE STATE (for SQL 2022).
Check the Queue: Navigate to Administration > Queue > Queue Details in the Web UI. This shows exactly which items are delayed and for how long, helping you identify if the issue is a single item or the entire plugin. Microsoft SQL monitoring and integration with Zabbix
This is a trending/front-end message from the Zabbix UI. It means the server has successfully requested data from the agent, but the value is persistently empty, NULL, or exceeds the zabbix.history sync period.
This often indicates:
Key insight: Zabbix does not time out on “no data” – it actively receives empty data. The problem is logical, not network connectivity.
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.
The "No data for 30m" error in MSSQL monitoring is rarely a network outage and almost always a script execution failure. By increasing the Timeout parameter to accommodate heavy SQL queries and ensuring PowerShell Execution Policies allow the scripts to run, administrators can restore data flow and maintain visibility into their database infrastructure.