New Question
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Download >>


What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more


Top Tags

View all Tags

How can I monitor free disk space of connected iSCSI shares on Xen servers?



Your Vote:



I use the SSH disk free sensor to monitor the free disk space of mounted devices on a Xen server. This works perfectly with NFS shares, but how can I read out the free disk space of iSCSI connected drives?

free-disk-space iscsi linux prtg script sensor ssh xen

Created on May 8, 2013 2:26:43 PM by  Gerald Schoch [Paessler Support]

1 Reply

Accepted Answer



Your Vote:



This article applies to PRTG Network Monitor 13 or later

Monitoring Free Disk Space of iSCSI Shares on Xen Servers

iSCSI mounts are not integrated as regular volumes. Because of this, they are not visible for the standard SSH Disk Free Sensor. However, PRTG’s SSH Script Sensor makes it possible to retrieve the desired information.

In order to monitor free disk space on a connected iSCSI device, create a small script file in combination with an SSH Script sensor. This custom sensor will return the utilization of the share in percent. You are also able to improve and adjust the script to your monitoring needs.

Please follow the steps below.

Steps to Go

  1. Open a text editor.
  2. Copy the script (see below) and paste it into the editor.
  3. Save the created script file and place it in the following path on your Xen server: var/prtg/scripts
  4. Ensure that the script file has executable rights and is accessible for the user defined in PRTG.
  5. Add a new SSH Script sensor to the corresponding device in PRTG, e.g., via Add Sensor… in the device’s context menu.
  6. Choose the created script from the dropdown list in the add sensor dialog (in section Script).
  7. In the field Parameters, provide the Universally Unique Identifier (UUID) of the connected iSCSI share. For example, 222ac029-3970-9e8b-060b-5e3870bc1302
    Note: You can get a list of all UUIDs available on your system using the following command: xe sr-list | grep -B2 -A3 iSCSI
  8. Select Float in section Value Type. Note: The percentage output of the example script in this article is a float value. If you use an adjusted or another script, make sure that you choose the correct value type here!
  9. Click on Continue.

The created sensor will start to monitor the free disk space immediately. This sensor works for all volume types which are available on a Xen server, even for Network File Systems (NFS) or local devices.


Please use the following script:


xe sr-list uuid=$1 params=physical-utilisation,physical-size | awk '{if (NR == 1) {pu = $NF}; if (NR == 2) {ps = $NF; print "0:" pu/ps*100 ":OK"}}' 

The script works like this:

  • xe: command to administrate the Xen kernel
  • sr-list: ‘storage-list’ to get all available storage systems on Xen Without additional parameters you will get an unfiltered list of all storages. In order to get specific values for a defined storage use the parameters below:
  • uuid: calls a specific storage, defined in the parameters field of the SSH Script sensor settings.
  • params: retrieves the desired values.

awk and the following statement calculates the utilization of the disk and returns a PRTG compatible output.

Created on May 8, 2013 2:40:19 PM by  Gerald Schoch [Paessler Support]

Last change on Nov 8, 2013 4:48:16 PM by  Gerald Schoch [Paessler Support]

Please log in or register to enter your reply.

Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.