This article applies to PRTG Network Monitor 13 or later
Monitoring Free Disk Space on a LUN of an iSCSI Target
Free disk space on a LUN (logical unit number) which represents an individually addressable logical iSCSI (Internet Small Computer System Interface) device cannot be monitored with the SSH Disk Free sensor. The reason is that the df command does not show these iSCSI targets. Though, you can still monitor NFS (Network File System) and CIFS (Common Internet File System) with this sensor type.
Monitoring iSCSI LUNs Using a Script
If a percentage value for free disk space on a LUN is sufficient for you, you can monitor this number in PRTG with an SSH Script Sensor. Please follow the steps below.
1. Create a script with the following content:
#!/bin/bash
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"}}'
2. Save it in the /var/prtg/scripts folder on the target system (i.e., on the Xen server).
3. Make the file executable with the change owner command:
chown <user> <script>
4. Determine the UUID (Universally Unique Identifier) of the iSCSI target on the Xen server. Use the following command to get a list of UUIDs of connected targets:
xe sr-list name-label='iSCSI storage' --minimal
5. For each listed UUID, create an SSH Script sensor in PRTG.
- Open the Add Sensor dialog in PRTG und select SSH Script.
- Select the created script from the drop list.
- Choose value type Float.
- As parameter, enter the particular UUID.
- Optionally, after sensor creation, open the settings of the Value channel. Enter % in the Unit field and choose Custom in section Decimal Places (you can leave the default value 2).
With these settings, the created sensor will show the free space on a particular LUN in percent.
Feel free to adjust the given script to your needs. Please consider the correct format for the returned data, see PRTG Manual: Custom Sensors for more information.
See Also
If you encounter wrong disk usage data, please see the following article in the Citrix Knowledge Center: XenCenter Shows Incorrect Usage Data
Add comment