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 ?
Article Comments
Attention: This article is a record of a conversation with the Paessler support team. The information in this conversation is not updated to preserve the historical record. As a result, some of the information or recommendations in this conversation might be out of date.
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.
| Value | Description |
| 0 | OK |
| 1 | WARNING |
| 2 | System Error (e.g. a network/socket error) |
| 3 | Protocol Error (e.g. web server returns a 404) |
| 4 | Content Error (e.g. a web page does not contain a required word) |
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
@ECHO OFF
ECHO 200:Value too high
REM Set PRTG Sensor to Warning by returning <1>
Exit 1
Demo Batchfile - Set sensorstate to error.bat
@ECHO OFF
ECHO 200:Value is much too high
REM Set PRTG Sensor to Error by returning <2>
Exit 2
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
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