Hello ! I'm trying to use EXE/SCRIPT sensor, how ever I cant find in any example how to change color of monitor status when some error occur. When I use linux SSH scripts I just need to send a different string like: echo "0:100:OK" to get green status or "1:0:ERROR" to get red status, but when I'm using exe I only get green status because all examples show "VALUE:STRING" I don't have the color variable. Can anybody try to help me with this issue ?
How to change status color of monitor sensor
Modified on 2025-06-10 21:40:21 +0200
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.
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.
Hello there and thank you for your KB-Post. Please refer to the table below for the exitcodes that you can use in exe scripts to change the status of the sensor.
This is documented in PRTG under Setup > PRTG API on the "Custom Sensors" tab. You'll also find some examples in the C:\Program Files (x86)\PRTG Network Monitor\Custom Sensors\EXE by default:
Demo Batchfile - Set sensorstate to warning.bat
Demo Batchfile - Set sensorstate to error.bat
You can also use the Advanced sensor variants and use the XML/JSON format, in this case you can use the <error>1</error> and <Warning>1</Warning> in the output to modify the sensor's status:
Best Regards,
Luciano Lingnau [Paessler Support]
Mar, 2017 - Permalink