Share via

Azure Monitor get free space on VM located in Azure

Joao Dias 1 Reputation point
2022-02-15T15:05:43.1+00:00

Hi,

I like to run a Azure log query to get the free space using Perf, but I would like to filter out all Servers/Machines that are not hosted at Azure!

Azure Monitor
Azure Monitor

An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.

0 comments No comments

1 answer

Sort by: Most helpful
  1. AnuragSingh-MSFT 21,566 Reputation points Moderator
    2022-02-18T08:34:51.807+00:00

    Hi @Anonymous

    Welcome to Microsoft Q&A! Thanks for posting the question.

    In order to get details of servers/machines not hosted in Azure from Logs, you can use the ComputerEnvironment == 'Non-Azure' column filter on Heartbeat table. The distinct SourceComputerId from the output can be matched against the AgentId or similar column in perf tables to get the metrics only from Non-Azure servers/machine.

    Here is a sample:

    let nonAzureComputers = Heartbeat | where ComputerEnvironment == 'Non-Azure'  
    | distinct SourceComputerId | project pack_array(SourceComputerId);  
    
    InsightsMetrics | where AgentId in~ (nonAzureComputers)  
    

    Please let me know if you have any questions.

    ---
    Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.