I created a custom sensor. When there is an error it returns this:
2:Error Description
I see the 2 and the description on PRTG however the sensor still is green and has a check OK. What am I missing?.
Article Comments
It I execute the code on the command line it returns this:
2:Error no connection
PRTG execs this same code and the value and the description both come through to PRTG. But the sensor must need to be setup to handle this or something.
Feb, 2018 - Permalink
This result means that the sensor value will be 2 then. Because the format for the response is:
value:message
If values above 0 mean an error, just define an error limit in the Channel Settings of the sensor accordingly.
Feb, 2018 - Permalink
My sensor app was printing to the console the error value and the description like the BAT examples do. However it seems as though PRTG was ALSO looking for a RETURN value.
Environment.Exit (2)
I added that in addition to the Console.Write (2,"Error Message");
Now it works.
I would have thought all custom sensors would act the same way but I was wrong.
Feb, 2018 - Permalink
Hi Mark,
thank you for the KB-Post. Can you share the exact verbose script result here?
If possible, also share the script.
thank you
Feb, 2018 - Permalink