Use property values in script body
System doesn’t support using property values in scripts from repository or scripts defined as text in the sensor directly.
However, there is a way to use existing functionality to pass property values in the script arguments. To set this up, perform the following actions:
-
Add the necessary properties to the object that will host the Program/script execution sensor.
-
In the Monitoring section add the Program/script execution sensor and select the script. This method works with any script subtype.
-
In the Arguments field set the properties in the variables format. Each property should be passed in its own argument.
-
In the script, use the arguments with the
$symbol ($1for the first argument,$2for the second one and so on).
When you set up the sensor this way, the system will pass property values in the script.