New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

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

 

Top Tags


View all Tags


Custom script: Return value from Linux server using SSH

Votes:

0

Your Vote:

Up

Down

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 http://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 by  Kenneth Fossum (0) 1

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



7 Replies

Votes:

0

Your Vote:

Up

Down

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

Your Vote:

Up

Down

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 by  Kenneth Fossum (0) 1



Votes:

0

Your Vote:

Up

Down

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

Your Vote:

Up

Down

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 by  Kenneth Fossum (0) 1



Votes:

0

Your Vote:

Up

Down

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 by  Elvira Soto Arjona (150) 1 1



Votes:

0

Your Vote:

Up

Down

@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

Your Vote:

Up

Down

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 by  Supermercados_Peruanos (0)



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.