Requêtes pour la table WVDAgentHealthStatus

Pour plus d’informations sur l’utilisation de ces requêtes dans le Portail Azure, consultez le didacticiel Log Analytics. Pour l’API REST, consultez Requête.

Sessions actives sur SessionHost

Afficher un graphique de sessions actives.

let GranularityInterval = 30m; // Time resolution for query results (min value is 30s).
WVDAgentHealthStatus // Fires every ~30s
// Ensure only one data point is provided per host in the pool
| summarize PeakSessionsByHost=max(toint(ActiveSessions)) by SessionHostName, bin(TimeGenerated, 30s), _ResourceId
// Sum up the values for all of the hosts in each pool
| summarize SessionsByHostPool=sum(PeakSessionsByHost) by TimeGenerated, _ResourceId
// Reduce time resolution to desired GranularityInterval and report the peak session count for each pool in that time window
| summarize max(SessionsByHostPool) by bin(TimeGenerated, GranularityInterval), _ResourceId
| render timechart

Contrôle d’intégrité de SessionHost

Affiche un résumé de l’état d’intégrité de SessionHost.

let HealthCheckIdToDescription = (idx:long) {
    case(
        idx == 0,  "DomainJoin",
        idx == 1,  "DomainTrust",
        idx == 2,  "FSLogix",
        idx == 3,  "SxSStack",
        idx == 4,  "URLCheck",
        idx == 5,  "GenevaAgent",
        idx == 6,  "DomainReachable",
        idx == 7,  "WebRTCRedirector",
        idx == 8,  "SxSStackEncryption",
        idx == 9,  "IMDSReachable",
        idx == 10, "MSIXPackageStaging",
        strcat("InvalidNameIndex: ", idx)
     )
};
let GetHealthCheckResult = (idx:long) {
    case(
        idx == 0, "Unknown",
        idx == 1, "Succeeded",
        idx == 2, "Failed",
        idx == 3, "SessionHostShutdown",
        strcat("InvalidResultIndex: ", idx)
    )
};
WVDAgentHealthStatus
// In some states (e.g. Unavailable, Upgrading) hosts are not running health checks
| where isnotempty(SessionHostHealthCheckResult)
| mv-expand SessionHostHealthCheckResult to typeof(dynamic)
| evaluate bag_unpack(SessionHostHealthCheckResult)
| evaluate bag_unpack(AdditionalFailureDetails)
| extend HealthCheckDesc = HealthCheckIdToDescription(HealthCheckName)
| summarize count(), FirstSeen=min(TimeGenerated), LastSeen=max(TimeGenerated) by HealthCheckDesc, SessionHostName, HealthCheckResult=GetHealthCheckResult(HealthCheckResult)