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

What's the batch response format for PRTG ?

Votes:

0

Hello,

I have a batch script used to get users connected to a RDS server. I use this command to talk with PRTG, but it does not suite.

ECHO "2:%COUNT%:Critical! Number of active sessions = %COUNT%"
EXIT

On my sensor the first parameter "2" is not taken into account, it should set the sensor in error.

And the message displays the following:

2:Error Number of active sessions = 2

The message is correct but why does it displays "2:"

Thanks for the answer.

batch format prtg script

Created on Jan 13, 2023 11:09:24 AM

Last change on Jan 16, 2023 8:11:23 AM by  Felix Wiesneth [Paessler Support]



4 Replies

Votes:

0

Hello,

You just need to remove in your code " ". For example following code

echo 200:ok

will return 200 and the message ok. Please adjust your script in this way. For further detailed information about how to use custom sensors, please take a look in our manual here.


Kind regards

Felix Wiesneth - Team Tech Support

Created on Jan 16, 2023 3:48:21 PM by  Felix Wiesneth [Paessler Support]



Votes:

0

Thank you for the answer.

Created on Jan 17, 2023 8:13:12 AM



Votes:

0

OK but I need to return the return code, the value calculated and a message, using variables.

Then what's the correct echo command ?

Created on Jan 17, 2023 12:03:50 PM



Votes:

0

Hi,

in your case you need to add the exit code like the following:

EXIT 2

Kind regards

Felix Wiesneth - Team Tech Support

Created on Jan 18, 2023 8:45:42 AM by  Felix Wiesneth [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.