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.
Article Comments
OK but I need to return the return code, the value calculated and a message, using variables.
Then what's the correct echo command ?
Jan, 2023 - Permalink
Hi,
in your case you need to add the exit code like the following:
EXIT 2
Kind regards
Felix Wiesneth - Team Tech Support
Jan, 2023 - Permalink
Hello,
You just need to remove in your code " ". For example following code
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
Jan, 2023 - Permalink