IOC Snapshot

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

expression_alt: | ( last(/MSSQL_Template/msql.info.fetch.status) = 1 and min(/MSSQL_Template/msql.info.fetch.status, 30m) = 1 ) or ( (now() - last(/MSSQL_Template/msql.last.success.time)) > 1800 )

Fetching MSSQL metrics (especially database sizes or heavy performance counters) can take longer than the default Zabbix timeout.

The "No data for 30m" Mechanism: If the script takes 15 seconds to run, but the Zabbix timeout is set to 3 seconds (default), the connection is cut. Zabbix registers this as a failed fetch. If this happens repeatedly, the item goes into a "Not Supported" state for a period (often 10-30 minutes) before retrying, causing the "No data for 30m" gap.

Solution: Increase the timeout value in the Zabbix Agent configuration file.


Disclaimer: This paper is for informational purposes. Always test configuration changes in a non‑production environment first.

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%% ```

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

"MSSQL: Failed to fetch info data (or no data for 30m)" typically indicates a failure in the communication link between the Zabbix Agent (or Server) and the SQL Server instance

. This is most often caused by incorrect credentials, missing ODBC drivers, or misconfigured connection parameters. Common Causes and Solutions Missing or Misconfigured ODBC Driver

: If you are using the "MSSQL by ODBC" template, ensure the Microsoft ODBC Driver is installed on the Zabbix Server (for passive checks) or Proxy. Verify that the driver is correctly defined in /etc/odbcinst.ini Authentication Issues

: The Zabbix monitoring user must have specific permissions to access system views. Ensure the user has VIEW SERVER STATE VIEW SERVER PERFORMANCE STATE for MSSQL 2022) and VIEW ANY DEFINITION permissions.

Verify that the credentials in your Zabbix host macros (e.g., $MSSQL.USER $MSSQL.PASSWORD ) match the SQL login. Connection String Problems Port Syntax : Microsoft SQL Server does not use the directive in some ODBC configurations; use Server = ipaddress,1433 (comma instead of colon). Encryption & Certificates

: If the SQL Server requires encrypted connections, you may need to add Encrypt=yes to the connection string or TrustServerCertificate=yes if you are using self-signed certificates. Agent 2 Plugin Configuration

: If using "MSSQL by Zabbix agent 2", the plugin configuration must be present in the zabbix_agent2.d/mssql.conf

file on the target host. Restart the Zabbix Agent 2 service after making any changes. Macro URI Errors : Ensure the $MSSQL.URI macro is correctly formatted as sqlserver://: or uses a named session defined in the agent configuration. Troubleshooting Steps Test Connection Manually (for ODBC) or zabbix mssql failed to fetch info data -or no data for 30m-

from the command line on the Zabbix server/agent host to verify that the connection works outside of Zabbix. Check Zabbix Logs : Look at the Zabbix Server or Agent log files (usually in /var/log/zabbix/

) for more specific error details, such as "Login failed" or "Driver not found". Increase Timeout

: If the SQL instance is under heavy load, the info fetch might timeout. Try increasing the parameter in the Zabbix server/agent configuration files. Detect Issues in Your Zabbix Instance Before It's Too Late 25 Mar 2026 —

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-

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 expression_alt: | ( last(/MSSQL_Template/msql

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

| Cause | Solution | |-------|----------| | Permission denied | GRANT VIEW SERVER STATE TO zabbix_user; | | Missing database | Ensure referenced DB is online or use WHERE DB_NAME() = 'master' | | SQL syntax error | Test query in SSMS before putting in Zabbix item. | | Agent 2 misconfiguration | Use correct connection string: Server=.;Trusted_Connection=True; |

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.

Common triggers:

On the same SQL host, enable:

Trigger on nodata(5m) for a known always-increasing counter like system.uptime. If uptime stops reporting, your whole SQL monitoring is dead.

recovery_expression: |
  last(/MSSQL_Template/ms.sql.fetch_success)=1 
  and 
  min(/MSSQL_Template/ms.sql.fetch_success, 5m)=1

This piece will trigger when:

The alert automatically recovers once successful fetches resume for 5 minutes.

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 Fetching MSSQL metrics (especially database sizes or heavy

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)

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