Zabbix Mssql Failed To Fetch Info Data -or No Data For 30m- 【720p — FHD】
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
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
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 zabbix mssql failed to fetch info data -or no data for 30m-
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
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 The "Failed to fetch info data" or "no
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
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 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: ODBC timeout – Default QueryTimeout (e
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
3.3 Timeout & Resource Constraints (No data for 30m)
- ODBC timeout – Default
QueryTimeout(e.g., 5s) too short for heavy DMVs. - Zabbix server poller timeout –
Timeout=3inzabbix_server.confinsufficient for slow queries. - MSSQL resource governor throttling Zabbix login.
3.1. Cause 1: PowerShell Execution Policy (Most Common)
Zabbix MSSQL templates utilize PowerShell scripts to query WMI and SQL management objects. By default, Windows Server restricts script execution.
Diagnosis:
Check the Zabbix Agent logs on the Windows MSSQL host (C:\Program Files\Zabbix Agent\zabbix_agentd.log). You will likely see:
Get-Item: Cannot find path '...' because it does not exist.ORAuthorizationManager check failed.
Solution: You must relax the PowerShell execution policy for the user running the Zabbix Agent service.
- Open PowerShell as Administrator.
- Check current policy:
Get-ExecutionPolicy -List - Set the policy for the
CurrentUserorLocalMachinescope:Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine
Note: If your scripts are downloaded from the internet, you may need to unblock them using Unblock-File.
5.1 Fix “Failed to fetch info data”
| 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; |
2. Trigger Configuration
trigger_name: "MSSQL: Failed to fetch info data OR no data for 30m"
severity: HIGH
expression: |
(
last(/MSSQL_Template/msql.info.fetch.status) = 1
and
min(/MSSQL_Template/msql.info.fetch.status, 30m) = 1
) or (
nodata(/MSSQL_Template/msql.info.fetch.status, 30m) = 1
)
3. Custom Script for Zabbix Agent (UserParameter)
# /etc/zabbix/zabbix_agentd.d/mssql.conf
UserParameter=perf.mssql[fetch.status],
/usr/local/bin/check_mssql_fetch.sh
UserParameter=perf.mssql[last_success],
/usr/local/bin/mssql_last_success.sh
check_mssql_fetch.sh:
#!/bin/bash
4. Verification Procedure
To confirm the fix, perform a manual query using zabbix_get from the Zabbix Server machine. This bypasses the frontend and allows immediate debugging.
Command:
zabbix_get -s <MSSQL_HOST_IP> -k "mssql.db.size[<DatabaseName>]"
- If this returns data: The Agent is working, and the issue is likely with the Server configuration or Frontend refresh.
- If this returns an error: The issue persists on the Host side (Permissions or PowerShell).
- If this hangs: The Timeout is too low.
Step 4 – Monitor MSSQL Side
Run this query during failure window:
SELECT
session_id,
login_name,
status,
last_request_start_time,
last_request_end_time,
text
FROM sys.dm_exec_sessions s
OUTER APPLY sys.dm_exec_sql_text(most_recent_sql_handle) t
WHERE login_name = 'zabbix_user';
Look for status = 'suspended' (blocked) or running for hours.
3.2 Query Execution Failures (Failed to fetch info data)
- Syntax error in custom SQL query used in ODBC item.
- Missing database – Query references a database that is offline, restoring, or auto-closed.
- Blocking/deadlock – Zabbix query becomes the victim.