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

script ssh : prtg incorrect response format

Votes:

0

Hello I try to run a script to see a folder exist or not but prtg return : incorrect response format. My script :

#!/bin/bash
if [ -d /root/autofs_daemon/ ];
then
echo "1:OK"
else
echo "0:BAD"
fi

script shell ssh

Created on Apr 1, 2022 5:38:12 PM

Last change on Apr 4, 2022 5:14:49 AM by  Felix Wiesneth [Paessler Support]



1 Reply

Votes:

0

Hello,

Thank you for your message.

The exit code is missing in the data returned to PRTG when comparing to the Custom Sensors manual, hence the message "incorrect response format". Therefore, I invite you to add 0: in each response returned as illustrated below:

#!/bin/bash
if [ -d /root/autofs_daemon/ ];
then
echo "0:1:OK"
else
echo "0:0:BAD"
fi

In case you use the SSH Script Advanced the sensor, the format must be changed to XML/JSON as indicated here: https://www.paessler.com/manuals/prtg/custom_sensors#advanced_sensors.

If you have questions, do not hesitate.

Regards.

Created on Apr 4, 2022 5:53:33 AM by  Florian Lesage [Paessler Support]




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.