Your_Template:mssql.info.fetch.fail.min(30m)=1 or Your_Template:mssql.info.fetch.data.nodata(30m)=1
Zabbix templates often use a parameter like $MSSQL.INSTANCE (default: MSSQLSERVER). For named instances, you must use HOSTNAME\INSTANCENAME or just the instance name, depending on the template.
Test with zabbix_get from the server:
zabbix_get -s 192.168.1.100 -k "perf_instance[\SQL2019\PROD,'SQLServer:General Statistics','User Connections']"
If this returns nothing, the instance name is wrong, or the ODBC DSN entry is missing.
Let’s go through the real-world scenarios I’ve encountered across hundreds of Zabbix-MSSQL deployments.
Disclaimer: This paper is for informational purposes. Always test configuration changes in a non‑production environment first.
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
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
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 zabbix mssql failed to fetch info data -or no data for 30m-
Run this script on your SQL Server to ensure the Zabbix user has the minimum required access:
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 "Failed to fetch info data" or "no data for 30m" error in Zabbix for MSSQL typically indicates a connection or permission failure between the Zabbix agent (or server/proxy via ODBC) and the SQL Server Immediate Troubleshooting Steps
MSSQL: Failed to fetch info data (or no data for 30m) - ZABBIX Forums
This review focuses on the common Zabbix alert: "MSSQL: Failed to fetch info data (or no data for 30m)."
This is a generic trigger often seen when using the "MSSQL by ODBC" or "MSSQL by Zabbix agent 2" templates. It indicates that the master "Info" item—which discovery and other dependent items rely on—is not receiving data. Core Causes & Fixes 1. Database Permissions (Most Common)
The Zabbix monitoring user requires specific permissions to access system views and performance counters. If these are missing, the query that fetches "info data" will fail. Ensure the monitoring user has these permissions: SERVER STATE [zabbix_user]; DEFINITION [zabbix_user]; -- For SQL Agent jobs monitoring: dbo.sysjobs [zabbix_user]; dbo.sysjobactivity [zabbix_user]; dbo.agent_datetime [zabbix_user]; Use code with caution. Copied to clipboard 2. ODBC Driver Configuration (Zabbix Server/Proxy)
MSSQL: Failed to fetch info data (or no data for 30m) - Zabbix
MSSQL: Failed to fetch info data (or no data for 30m) - suggestions * Posts. * Latest Activity. * Photos. Microsoft SQL monitoring and integration with Zabbix
"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
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)
The error "MSSQL: Failed to fetch info data (or no data for 30m)" typically indicates a communication failure between the Zabbix server/proxy and the Microsoft SQL instance, often stemming from ODBC misconfiguration, authentication issues, or network restrictions. Key Troubleshooting Areas
MSSQL: Failed to fetch info data (or no data for 30m) - Zabbix
tester777. Junior Member. Joined: Aug 2020. Posts: 9. #1. MSSQL: Failed to fetch info data (or no data for 30m) - suggestions. 18- Your_Template:mssql
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- ODBC Configuration & DSN
Port Formatting: MSSQL does not use the standard port= directive in odbc.ini. It must be specified with a comma after the IP address (e.g., Server = 192.168.1.100,1433).
Named Instances: If using a named instance, ensure the macro $MSSQL.INSTANCE is set correctly (e.g., MSSQL$InstanceName). For default instances, this macro should remain unchanged.
Trust Certificates: If you can connect via sqlcmd but not Zabbix, you may need to specify TrustServerCertificate=Yes in your odbc.ini file or ensure the Microsoft ODBC Driver 18 is properly handling encryption. Database Permissions
The Zabbix monitoring user needs specific permissions to gather performance data. Missing these will cause data fetching to fail even if the connection is established.
Required Permissions: GRANT VIEW SERVER STATE (or VIEW SERVER PERFORMANCE STATE for 2022+), VIEW ANY DEFINITION, and specific SELECT and EXECUTE rights on msdb objects. Zabbix Backend Configuration
ODBC Pollers: Ensure that ODBC pollers are active by setting StartODBCPollers to at least 1 in your zabbix_server.conf or zabbix_proxy.conf file.
Macro Settings: Verify that the host macros $MSSQL.USER, $MSSQL.PASSWORD, and $MSSQL.DSN exactly match the settings in your odbc.ini file. Network & Testing
Connectivity Test: Run isql -v YourDSNName from the Zabbix server command line as the zabbix user to see if a raw ODBC connection works.
Agent 2 Plugins: If using Zabbix Agent 2, ensure the mssql.conf plugin file is present in the zabbix_agent2.d/plugins.d/ directory and that the Include= directive is active.
Are you using Zabbix Agent 2 or the ODBC-based template for this monitoring?
MSSQL: Failed to fetch info data (or no data for 30m) - Zabbix
tester777. Junior Member. Joined: Aug 2020. Posts: 9. #1. MSSQL: Failed to fetch info data (or no data for 30m) - suggestions. 18-
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- Microsoft SQL monitoring and integration with Zabbix
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 Zabbix templates often use a parameter like $MSSQL
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%% ```
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
This specific error in Zabbix typically triggers when the monitoring system hasn't received any data from the MSSQL instance for a prolonged period (30 minutes), often due to ODBC configuration issues or insufficient permissions for the monitoring user. Alert Message Draft
You can use the following text for your trigger name or notification body:
Trigger Name: MSSQL: Failed to fetch info data (or no data for 30m)
Problem Description: No monitoring data has been received from the MSSQL instance on HOST.NAME for at least 30 minutes. This may indicate a connection failure, an ODBC driver issue, or an expired monitoring user session. Troubleshooting & Fixes
If this alert is active, check the following common causes identified by users in the Zabbix Community Forums:
ODBC Configuration: Ensure the odbc.ini file does not store credentials. For Zabbix, username and password should be passed as arguments from the frontend.
Port Syntax: MSSQL servers often require a comma before the port in the connection string (e.g., Server = ipaddress,1433) rather than a colon.
Encryption Settings: Try adding Encrypt = yes to your connection parameters.
SSL Certificates: If your server uses a self-signed certificate, you may need to include TrustServerCertificate=Yes in your odbc.ini or connection string to prevent handshake failures.
User Permissions: Verify the monitoring user has the required rights. For MSSQL 2022, you must grant VIEW SERVER PERFORMANCE STATE and VIEW ANY DEFINITION. Trigger Expression Example
To customize the time period or item, the standard expression for a 30-minute "no data" alert looks like this: nodata(/Host/mssql.info_item,30m)=1 If you'd like, I can help you:
Draft a remediation script to restart the Zabbix agent or ODBC services.
Provide the exact SQL commands to verify your monitoring user's permissions.
Adjust the Zabbix Action to send this alert to Slack, Discord, or Email. Let me know which Zabbix version you are currently running!
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-
Zabbix nodata trigger, really a lifesaver | by Werner Dijkerman