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 script: Return value from Linux server using SSH

Votes:

0

Hi there I have a script on my Varnish server that outputs the number of connections to my Varnish instance. This is done using the following command:

varnishstat -1 -f client_req | awk '{ print $2 }' 

PRTG finds my script, which is in /var/prtg/scripts, and furthermore, it executes it and returns the correct number of connections. But, the sensor errors out with "response not well-formed".

Response not wellformed: "2321 " (code: PE132)

The sensor is the SSH script sensor - integer defined. PRTG 12.

My question is; what is not well formed about the output? I have seen the value:message reply given in https://www.paessler.com/knowledgebase/en/topic/31683-custom-script-sensor-error, but I would like someone to elaborate on that if it applies to my question.

Thank you.

custom-sensor linux script ssh ubuntu varnish

Created on Oct 1, 2012 8:54:23 PM

Last change on Oct 4, 2012 1:37:25 PM by  Daniel Zobel [Product Manager]



7 Replies

Votes:

0

Hi,
first, please note that the article you are referring to is only addressing script sensors on Windows Systems where the return has to be

value:message
Exit Code

On Linux Systems and with the SSH Script Sensor you will have to return the values in a different way. Please find below the notation for the return values in the SSH Script Sensor:

returncode:value:message

Where return code can be

ValueDescription
0OK
1WARNING
2System Error (e.g. a network/socket error)
3Protocol Error (e.g. web server returns a 404)
4Content Error (e.g. a web page does not contain a required word)

For a script example, please refer to this article as well.
Best regards

Created on Oct 2, 2012 6:04:11 AM by  Konstantin Wolff [Paessler Support]



Votes:

0

OK, but this is a "up or down" approach you are taking. I am not doing that. I have something else taking care of the health checks. I just want to graph out the values returned from my script. Can I do that?

Created on Oct 2, 2012 12:39:03 PM



Votes:

0

Hi,
yes, you can deliver back any value you want in the "value" (float or integer) which then will be contained in the graph. The script only should show the possibilities what can be done with the sensor.
Best regards

Created on Oct 2, 2012 12:44:36 PM by  Konstantin Wolff [Paessler Support]



Votes:

0

Oki, great :-) I will get started. Appreciate the feedback. Thank you. I will make sure to update the post with my working solution.

Created on Oct 2, 2012 12:52:12 PM



Votes:

0

Good morning

after update to the version 14.2.10.2114, my powershell script returns this error. Before of update, the powershell worked correctly.

This is my code:

write-host 2, "Error" $message

Created on Jun 23, 2014 8:03:32 AM



Votes:

0

@BORJA RODRIGUEZ: Would you mind opening a new thread for this as your issue seems to be related to Powershell and this thread refers to SSH scripts?
Thank you!

Created on Jun 23, 2014 8:17:15 AM by  Konstantin Wolff [Paessler Support]



Votes:

0

Hi Kenneth Fossum: Could you please share the solution you applied to output format to the command you wanted to execute ?. I have the same problem as you say.

Created on Dec 7, 2016 4:54:15 PM




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.