Capturing Citrix XenServer performance data with PowerShell

Capturing performance data is important to fully understand the impact of changes. With automation, you can guarantee a consistent data capture which is important to compare different scenarios. In this blog post, I’m going to share how to capture Citrix XenServer performance data with PowerShell.

Requirments for SSH

In order to fully automate the capturing, you need a way to connect to the XenServer host using SSH. This can be done with the PowerShell module Posh-SSH which is required for the examples below. You can install the module manually or use the following example to install the module automatically.

Please note: an internet connection is required.

Capturing the XenServer data

To capture the performance data a couple of variables needs to be assigned. First, it is important to specify the XenServer host, username and password. These will be used to connect to the XenServer host using SSH. The testname will be used as the primary name for the CSV file. Consistent data is important so you can compare multiple scenarios. The timeout and delay are used to define the total time to capture the data and the interval. In the example below data is captured for 10 minutes with a 30 seconds interval. I’m always using jobs to capture performance data because this allows me to do other tasks during the capture.

RRD2CSV is the primary tool for capturing the performance data. More information can be found here.

Downloading the data from XenServer

In order to analyze the results, you need to download the performance data from the XenServer host. This can also be done using the Posh-SSH module! Using the Get-SCPFile you are able to download the file to your local disk.

A quick tip! With the PPD you can quickly create charts in Microsoft Excel out of the XenServer performance data! More info here.


With the examples above you are able to fully automate capturing and downloading performance data from XenServer. Thanks to the module Posh-SSH this can be done with PowerShell. Using this method is a consistent way to capture the data so you can compare different scenarios. I hope this blog post is useful and if you have any comments or questions please leave them below.


Photo by Chris Holgersson on Unsplash