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

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

How do I prevent SSH Disk Free monitoring Ubuntu snap partititons

Votes:

0

Your Vote:

Up

Down

Hi, my company uses prtg "ssh disk free" to monitor Ubuntu snap partitions. Snap partitions are (by default) very small, so fill up quickly and alarm during out of hours. I am trying to find a way to prevent snap partitions being monitored.

I have tried modifying the 'df' that runs on he server with an alias:

  • The "ssh disk free" check performs the periodic command: df -TP -x tmpfs -x devtmpfs -x debugfs

I created a new user and a bash alias on the client server for df: alias df="df -x squashfs"

I was attempting to modify df so it wouldn't display squashfs. the df would be running the command df -TP -x tmpfs -x devtmpfs -x debugfs -x squashfs

However, the logs generated have not changed.

Can anyone advise me? Thanks

df prtg ssh

Created on Sep 16, 2022 3:35:01 PM by  danielloizosswish (0) 1



5 Replies

Votes:

0

Your Vote:

Up

Down

Hi Daniel,

Thank you for your message.

To avoid the SSH Disk Free sensor to create channel for new snap partitions, I invite you to create the sensor anew. When doing that, please make sure to keep the snap partitions not selected/enabled.

The sensor should not create snap channel anymore afterwards.

Regards.

Created on Sep 19, 2022 7:39:29 AM by  Florian Lesage [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Thanks for your reply. I appreciate it. Does PRTG off the possibility to modify checks/commands such as 'df'?

Thanks

Created on Sep 20, 2022 8:40:06 AM by  danielloizosswish (0) 1



Votes:

0

Your Vote:

Up

Down

Hi Dianel,

I'm afraid that it is not possible to modify the command executed by the sensor. However, you have the possibility to use yours via a custom script, executed by the SSH Script or SSH Script Advanced sensor.

In that case, the script must return a response in the corresponding format: https://www.paessler.com/manuals/prtg/custom_sensors

If you have further questions, do not hesitate.

Regards.

Created on Sep 21, 2022 5:05:14 AM by  Florian Lesage [Paessler Support]



Votes:

0

Your Vote:

Up

Down

In the end the solution was to write a script, which can be seen here:

#!/bin/bash
# filename: check_prtg_free_bytes.sh
# author: D P Loizos [email protected]
# create date: 20/9/2022
# description: a PRTG check that displays free bytes, for various filesystems, ignoring tmpfs, devtmpfs, squashfs. PRTG prefers XML as its output machanism.

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

# get free bytes
FREEB=$(df -T -x tmpfs -x devtmpfs -x squashfs | egrep -v 'Available' | awk '{ print $5}')
MOUNT_FREEB=( $FREEB )

# build the XML file, iterating through two arrays
echo "<prtg>"
n=0
for i in "${MOUNT_ARRAY[@]}"
do
        echo "  <result>"
        echo "    <channel>Mount: $i</channel>"
        echo -e "      <value> ${MOUNT_FREEB[n]} </value>"
        n=$(($n+1))
        echo "  </result>"
done

echo "</prtg>"

Created on Sep 21, 2022 1:26:11 PM by  danielloizosswish (0) 1

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



Votes:

0

Your Vote:

Up

Down

Hi Daniel,

Thank you for your feedback and for sharing a script.

Do not hesitate to contact the support again if needed.

Have a great day.

Regards.

Created on Sep 22, 2022 5:07:37 AM by  Florian Lesage [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.