Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Azure资源监视与zabbix一起返回空度量值_Azure_Powershell_Monitoring_Zabbix_Azure Monitoring - Fatal编程技术网

Azure资源监视与zabbix一起返回空度量值

Azure资源监视与zabbix一起返回空度量值,azure,powershell,monitoring,zabbix,azure-monitoring,Azure,Powershell,Monitoring,Zabbix,Azure Monitoring,我将此纸条用于Zabbix的Azure监控: 在从azure rest API获取度量值的最后一步之前,一切都正常工作,正如预期的那样。 用于获取度量值的命令是“/usr/lib/zabbix/externalscripts/get.azure.metrics.values.sh”。当我执行脚本时,我得到以下日志 VERBOSE: Building result array for pushing to Zabbix server. VERBOSE: VERBOSE: Item 20/20 VE

我将此纸条用于Zabbix的Azure监控:

在从azure rest API获取度量值的最后一步之前,一切都正常工作,正如预期的那样。 用于获取度量值的命令是“
/usr/lib/zabbix/externalscripts/get.azure.metrics.values.sh
”。当我执行脚本时,我得到以下日志

VERBOSE: Building result array for pushing to Zabbix server.
VERBOSE:
VERBOSE: Item 20/20
VERBOSE: Parsing item key 'azure.resource[ASP-appserviceRG-914f, appServicePlan, TcpTimeWait , PT1M]' and getting variables to make REST request.
VERBOSE: Getting time span for item 'ASP-appserviceRG-914f/ASP-appserviceRG-914f TCP Time Wait' (id=29338) to determine period to pull metrics from Azure.
VERBOSE: Getting Zabbix history for item '29338'.
VERBOSE: Successfully fetched Zabbix history for item '29338'. VERBOSE: Item 'ASP-appserviceRG-914f/ASP-appserviceRG-914f TCP Time Wait' (id=29338) has no values (possibly new item?). VERBOSE: Current Epoch time (-3 minutes): 1620122220. VERBOSE: Timespan = '2021-05-01T10:00:00Z - 2021-05-04T09:57:00Z'.
Get-ZaAzureMonitorMetricValue: /usr/lib/zabbix/externalscripts/helpers/Set-ZaAzureMonitorZabbixHostItemValue.ps1:80
Line |
80 | $metrics = Get-ZaAzureMonitorMetricValue @params;
| ~~~~~~~
| Cannot bind argument to parameter 'subscriptionId' because it is an empty string.

VERBOSE: Building result array for pushing to Zabbix server.
VERBOSE: Writing metrics to 'imports' file.
VERBOSE: Finished write to file.
VERBOSE: /usr/lib/zabbix/externalscripts//imports/appservice_2021-05-04T10-00-00Z.imports
VERBOSE: Pushing '/usr/lib/zabbix/externalscripts//imports/appservice_2021-05-04T10-00-00Z.imports' to Zabbix server.
sent: 0; skipped: 0; total: 0
VERBOSE: Sending 'azureMonitor.lastUpdated' semaphore to the Zabbix host.
Response from "localhost:10051": "processed: 0; failed: 1; total: 1; seconds spent: 0.000023"
sent: 1; skipped: 0; total: 1
VERBOSE: Logging out from Zabbix.
VERBOSE: Successfully logged out from Zabbix. True Removing lock file 'get-azure-metrics-values_appservice.lck'. Transcript stopped, output file is /var/log/azure-script/PowerShell_transcript.nginx.O+Azuz4a.20210504095954.txt
但对于成功执行脚本的人员,有以下日志(预期行为):

执行脚本时必须登录azure并获取度量值并将其写入文件,但在我的情况下,它在第80行抛出错误,并且没有登录azure以获取度量值,因此作为回报,该文件为空

感谢您的任何帮助,任何提示都可以。如果你需要更多的细节,一定要告诉我

VERBOSE: Item 45/84
VERBOSE: Parsing item key 'azure.resource[LINUX-TEST,virtualMachines,Data Disk Queue Depth,PT1M,Average]' and getting variables to make REST request.
VERBOSE: Getting time span for item 'Data Disk Queue Depth (Preview) - LINUX-TEST' (id=86687) to determine period to pull metrics from Azure.
VERBOSE: Getting Zabbix history for item '86687'.
VERBOSE: Successfully fetched Zabbix history for item '86687'.
VERBOSE: Timespan = '2020-07-02T19:42:00Z - 2020-07-02T15:13:25Z'.
VERBOSE: Logging to Azure.
VERBOSE: Azure Monitor API header built.
VERBOSE: Getting metric values from Azure Monitor with parameters:
VERBOSE: - resourceName = 'LINUX-TEST'
VERBOSE: - resourceType = 'virtualMachines'
VERBOSE: - subscriptionId = 'ece9a1a6-d2d7-4284-b2fd-865d967c7024'
VERBOSE: - resourceGroupName = 'FISA-TEST';
VERBOSE: - timeSpan = '2020-07-02T19:42:00Z - 2020-07-02T15:13:25Z'
VERBOSE: - timeGrain = 'PT1M'
VERBOSE: - metricName = 'Data Disk Queue Depth'
VERBOSE: Building URI to pull metrics from Azure Monitor.
VERBOSE: URI: management.azure.com/subscriptions/ece9a1a6-d2d7-4284-b2fd-865d967c7024/resourceGroups/FISA-TEST/providers/Microsoft.Compute/virtualMachines/LINUX-TEST/providers/microsoft.insights/metrics?timespan=2020-07-02T19:42:00Z/2020-07-02T15:13:25Z&interval=PT1M&api-version=2018-01-01&metricnames=Data Disk Queue Depth&aggregation=Average