[ZBX-23499] Azure by HTTP - SQL doesn't work Created: 2023 Oct 04  Updated: 2024 Jun 25  Resolved: 2024 Jun 25

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Templates (T)
Affects Version/s: 6.4.7
Fix Version/s: 6.0.32rc1, 6.4.17rc1, 7.0.1rc1, 7.2.0alpha1

Type: Problem report Priority: Trivial
Reporter: Marco Hofmann Assignee: Aleksejs Abrosimovs
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Debian 11 amd64
MariaDB
Zabbix 6.4.7


Attachments: PNG File image-2023-10-04-12-06-47-913.png     PNG File image-2023-10-04-12-08-31-262.png     PNG File image-2023-10-04-12-09-01-659.png     PNG File image-2023-10-04-12-09-34-117.png     PNG File image-2023-10-05-11-59-39-123.png    
Issue Links:
Duplicate
Team: Team INT
Story Points: 1

 Description   

Steps to reproduce:

  1. Import Template Azure by HTTP
  2. https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/cloud/azure_http?at=refs%2Fheads%2Frelease%2F6.4
  3. Set permissions according to docs:
  4. https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/cloud/azure_http/README.md?at=refs%2Fheads%2Frelease%2F6.4
  5. Create host with credentials

Result:
Storage discovery metrics work.

Microsoft SQL Server discovery works, but all data collection fails

Error:
Failed to receive data:
cpu_percent,physical_data_read_percent,log_write_percent,storage,connection_successful,connection_failed,blocked_by_firewall,deadlock,storage_percent,xtp_storage_percent,workers_percent,sessions_percent,sessions_count,cpu_limit,cpu_used,sqlserver_process_core_percent,sqlserver_process_memory_percent,tempdb_data_size,tempdb_log_size,tempdb_log_used_percent : Request failed with status code 400: {"error":{"additionalInfo":[{"type":"string","info":"TraceId={3d83a644-5463-4e29-912a-118835295d8d}"},{"type":"string","info":"ExceptionType=Microsoft.Online.Metrics.MetricsMP.Utilities.RPRequestFormatException"}],"code":"BadRequest","message":"Failed to find metric configuration for provider: Microsoft.Sql, resource Type: servers/databases, metric: cpu_limit, Valid metrics: cpu_percent,physical_data_read_percent,log_write_percent,dtu_consumption_percent,storage,connection_successful,connection_failed,connection_failed_user_error,blocked_by_firewall,deadlock,storage_percent,xtp_storage_percent,workers_percent,sessions_percent,sessions_count,dtu_limit,dtu_used,sqlserver_process_core_percent,sqlserver_process_memory_percent,sql_instance_cpu_percent,sql_instance_memory_percent,tempdb_data_size,tempdb_log_size,tempdb_log_used_percent,allocated_data_storage,ledger_digest_upload_success,ledger_digest_upload_failed"}}
full_backup_size_bytes,diff_backup_size_bytes,log_backup_size_bytes : Request failed with status code 400: {"error":{"additionalInfo":[{"type":"string","info":"TraceId={61b9ffe6-9f16-4bef-aad4-9c42f59bc3d3}"},{"type":"string","info":"ExceptionType=Microsoft.Online.Metrics.MetricsMP.Utilities.RPRequestFormatException"}],"code":"BadRequest","message":"Failed to find metric configuration for provider: Microsoft.Sql, resource Type: servers/databases, metric: full_backup_size_bytes, Valid metrics: cpu_percent,physical_data_read_percent,log_write_percent,dtu_consumption_percent,storage,connection_successful,connection_failed,connection_failed_user_error,blocked_by_firewall,deadlock,storage_percent,xtp_storage_percent,workers_percent,sessions_percent,sessions_count,dtu_limit,dtu_used,sqlserver_process_core_percent,sqlserver_process_memory_percent,sql_instance_cpu_percent,sql_instance_memory_percent,tempdb_data_size,tempdb_log_size,tempdb_log_used_percent,allocated_data_storage,ledger_digest_upload_success,ledger_digest_upload_failed"}}


 Comments   
Comment by Victor Breda Credidio [ 2023 Oct 05 ]

Hi Marco.
Thank you for your report.

I know that the expected is that when we set a template it works following the basic steps from the documentation provided. 
In this particular case, I suspect that the issue is related to some configuration on Azure side. 

I've made a research on this error returned on Azure, and got the following from Microsoft Azure Management Pack Full Guide:

Issue: “Failed to find metric configuration for provider” Warning on specific metrics with event id 6400 occurs each 15 minutes.

Issue may happen because some resources fail to return metrics from Azure, for example web/sites (CPUTime) or publicIPAddresses metrics.

Resolution: Check if metric available and collected for specified service on Azure portal. If metric cannot be configured uncheck this metric in Azure MP Wizard > Metrics tab or add service instance to Exclude list.

The approach mentioned in this forum may provide some insight on this: 
https://social.technet.microsoft.com/Forums/en-US/516522fe-30cb-467b-8808-0a88de6dfe10/azure-monitoring-is-not-working-in-scom?forum=operationsmanagergeneral 

Comment by Marco Hofmann [ 2023 Oct 05 ]

Hi, thanks for your answer. But I don't see how this should help me.

I set the permissions as required:

We deleted the Service principal several times, and re-created it.

As an MSP, we have various Azure tenants to monitor. I even set this up among numerous Azure tenants. All report the same error:

{"errors":"Failed to receive data:\ncpu_percent,physical_data_read_percent,log_write_percent,storage,connection_successful,connection_failed,blocked_by_firewall,deadlock,storage_percent,xtp_storage_percent,workers_percent,sessions_percent,sessions_count,cpu_limit,cpu_used,sqlserver_process_core_percent,sqlserver_process_memory_percent,tempdb_data_size,tempdb_log_size,tempdb_log_used_percent : Request failed with status code 400: {\"error\":{\"additionalInfo\":[{\"type\":\"string\",\"info\":\"TraceId={aff6ab96-7aaa-4976-9439-5f29061c609e}\"},{\"type\":\"string\",\"info\":\"ExceptionType=Microsoft.Online.Metrics.MetricsMP.Utilities.RPRequestFormatException\"}],\"code\":\"BadRequest\",\"message\":\"Failed to find metric configuration for provider: Microsoft.Sql, resource Type: servers/databases, metric: cpu_limit, Valid metrics: cpu_percent,physical_data_read_percent,log_write_percent,dtu_consumption_percent,storage,connection_successful,connection_failed,connection_failed_user_error,blocked_by_firewall,deadlock,storage_percent,xtp_storage_percent,workers_percent,sessions_percent,sessions_count,dtu_limit,dtu_used,sqlserver_process_core_percent,sqlserver_process_memory_percent,sql_instance_cpu_percent,sql_instance_memory_percent,tempdb_data_size,tempdb_log_size,tempdb_log_used_percent,allocated_data_storage,ledger_digest_upload_success,ledger_digest_upload_failed\"}}\nfull_backup_size_bytes,diff_backup_size_bytes,log_backup_size_bytes : Request failed with status code 400: {\"error\":{\"additionalInfo\":[{\"type\":\"string\",\"info\":\"TraceId={fa1c15f0-e693-43f6-a427-07212f503404}\"},{\"type\":\"string\",\"info\":\"ExceptionType=Microsoft.Online.Metrics.MetricsMP.Utilities.RPRequestFormatException\"}],\"code\":\"BadRequest\",\"message\":\"Failed to find metric configuration for provider: Microsoft.Sql, resource Type: servers/databases, metric: full_backup_size_bytes, Valid metrics: cpu_percent,physical_data_read_percent,log_write_percent,dtu_consumption_percent,storage,connection_successful,connection_failed,connection_failed_user_error,blocked_by_firewall,deadlock,storage_percent,xtp_storage_percent,workers_percent,sessions_percent,sessions_count,dtu_limit,dtu_used,sqlserver_process_core_percent,sqlserver_process_memory_percent,sql_instance_cpu_percent,sql_instance_memory_percent,tempdb_data_size,tempdb_log_size,tempdb_log_used_percent,allocated_data_storage,ledger_digest_upload_success,ledger_digest_upload_failed\"}}","metrics":{"allocated_data_storage":{"timeStamp":"2023-10-05T09:57:00Z","average":30047993856}},"health":{"availabilityState":"Available","title":"Available","summary":"There aren't any known Azure platform problems affecting this SQL database or SQL data warehouse.","reasonType":"","category":"Not Applicable","context":"Not Applicable","occuredTime":"2023-09-05T00:00:00Z","reasonChronicity":"Persistent","reportedTime":"2023-10-05T09:58:15.9454443Z"}}
Comment by Aleksejs Abrosimovs [ 2024 Jun 25 ]

According to the error message, you are using DTU-based MSSQL. Unfortunately, Zabbix do not have a template for this type of MSSQL yet.

Your database is falsely discovered as Provisioned vCore based databases, causing wrong template to be attached, which returns errors.

A template for DTU-based MSQSL databases is on its way. You can follow it here: ZBXNEXT-9271

Sorry for the inconvenience caused.

Generated at Sun Apr 06 20:56:10 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.