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


SSH scripting result

Votes:

0

Your Vote:

Up

Down

I use PRTG in evaluation version and am very happy with it, I have a question for more experienced users

I created a SSH script to test active processes at a Linux server. This script test if a process runs the script returns an OK Return level (0:0:proces is running) This works fine.

The problem i have is the situation when the process isn't active. The returnvalue "0:1:process is not running" leaved the prtg test result OK the result tekst change tot "process is not runnng" but I want to change the test result in fault. This because the checked process isn't running.

I can set limits on the result value of the test to change the prtg check status from OK to failure however the test result text shows then the limit fault (limit fault messages, if set) and not the result text from the script.

I can also change the returnvalue in 1:x:faulttext the result is the prtg test status change to warning and not to error. The returnvalues 2,3,4:x:faulttext results in a test fault however a process, content or system failure and the test result shows this in the text.

The workaround I created is returnvalue 5::faulttext. The result of this return value is a test failure with as result text ":faulttest"

Is there a way to set the prtg test in failure in a correct way

Best regards,

Peter

notifications ssh-script test

Created on Apr 9, 2015 8:55:46 AM by  compaxo (0) 1



5 Replies

Accepted Answer

Votes:

5

Your Vote:

Up

Down

> I can also change the returnvalue in 1:x:faulttext the result is the prtg test status change to warning and not to error.

The returnvalue has to be one of the following values:

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)

So using returncode 2 will set your sensor to an error

Created on Apr 9, 2015 10:15:17 AM by  PRTG Tools Family [prtgtoolsfamily.com] (13,065) 3 4



Votes:

0

Your Vote:

Up

Down

Thanks for the reply and i was aware of the return codes however the defaults returncodes put additional text to the sensor result tekst

so will returncode 2 reult in de result message systemerror+"Custom errortext from returnvalue" + (errorcode PE022)

I want to test on the exsting of a file. I use a ssh script sensor so I have with the returncode control of the status messages of the sensor I want the sensor in ok status when the file doesn't exixts and in error when the file exists (because that is an indication to me that something goes wrong)

The script returns returnvalue 0 with a custom status message Sofar so good.

However I can choose 3 errorcodes with a custom status message if the file does exists however this 3 errorcodes put there own explanation (together with mine custom status message) in de status messages of the sensor.

And if the file does exist isn't this a system-, protocol, or content error. So I want to get rid of this additional messages.

Created on Apr 10, 2015 8:02:54 AM by  compaxo (0) 1



Votes:

4

Your Vote:

Up

Down

If you want the original message in you error message, you should not use limits. Disabling limits on your sensor should bring back your own message.

Created on Apr 10, 2015 8:26:27 AM by  PRTG Tools Family [prtgtoolsfamily.com] (13,065) 3 4



Votes:

0

Your Vote:

Up

Down

When I disable the limits and I return 1:x:custom errormessage

The sensor goes in error state and brings "system error custom errormassage (errorcode PEO22)"

I only want to see the error state with the message custom error message

with the returnvalues 1,2,3,4 I get additional text added to mine custom message wich I not want.

Created on Apr 17, 2015 9:16:37 AM by  compaxo (0) 1



Votes:

0

Your Vote:

Up

Down

Dear Compaxo

To define a custom message in error state, please use the SSH Script Advanced sensor and return an XML similar to this:

 <prtg>
 <error>1</error>
 <text>Your error message</text>
 </prtg>

However this way, no sensor value can be returned. If you like to return a value, you don't have full control of the sensor status message.

Created on Apr 20, 2015 9:15:05 AM by  Arne Seifert [Paessler Support]

Last change on Apr 20, 2015 9:19:25 AM by  Arne Seifert [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.