What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general.

Learn more

PRTG Network Monitor

Intuitive to Use. Easy to manage.
More than 500,000 users rely on Paessler PRTG every day. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free Download

Top Tags

View all Tags

Custom SSH Script Advanced XML <values> don't match the values in the prtg-desktop output



I wrote a script, however when it runs in prtg-desktop, the values display as zero.

The script is shown below:

# description: a PRTG check that displays free space, for various filesystems, ignoring tmpfs, devtmpfs, squashfs. PRTG prefers XML as its output machanism.

# get mount name
MOUNT=$(df -Th -x tmpfs -x devtmpfs -x squashfs | egrep -v 'Filesystem' | awk '{print $7}')

# get free space
FREES=$(df -Th -x tmpfs -x devtmpfs -x squashfs | egrep -v 'Used' | awk '{ print $4}')

# build the XML file, iterating through two arrays
echo "<prtg>"
for i in "${MOUNT_ARRAY[@]}"
        echo "  <result>"
        echo "    <channel>Mount: $i</channel>"
        echo -e "      <value> ${MOUNT_FREES[n]} </value>"
        echo "  </result>"

echo "</prtg>"

XML is generated in logs on the backend server:

  <channel>Mount: /</channel>
  <channel>Mount: /boot</channel>
  <channel>Mount: /data</channel>

The PRTG-Desktop output is as follows:

ChannelIDLast ValueMinimumMaximum
Execution Time1612msec529msec698msec
mount: /0 #0 #0 #
mount: /boot0 #0 #0 #
mount: /data0 #0 #0 #

As you can see XML <values> don't match the values in the prtg-desktop output. Please could you suggest why that is?


df prtg ssh

Created on Sep 21, 2022 1:13:53 PM

Last change on Sep 21, 2022 2:08:55 PM by  Felix Wiesneth [Paessler Support]

1 Reply



I solved this problem

df -h does not work because the output is letters and numbers.

Created on Oct 9, 2022 6:39:04 AM

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.