Monitoring using Microsoft PowerShell
XenApp provides an SDK based on Microsoft Windows PowerShell Version 3.0.
Using Citrix cmdlets and snap-ins, you can perform the same tasks as you would with the management console (Citrix Studio). Moreover, you can also write PowerShell scripts that retrieve performance or health data from your Citrix infrastructure to integrate with your external monitoring tool.
For example, I used PowerShell scripts to monitor XenApp installations with Nagios, a widely-used open source monitoring tool.
Note
The PowerShell SDK is compatible only with XenDesktop 5.0 or later. Snap-in names end with V1 or V2; they denote the following versions:
- V1 is for XenDesktop 5
- V2 is for XenDesktop 7 or later and for XenApp 7.5
In Chapter 1, Designing the New FlexCast® Management Architecture, you learned the following command to import all the Citrix plugins:
PS C:\> asnp Citrix*
This command must be at the top of every script that uses Citrix commands.
In the following sections...