Triggers
In this section it is possible to set scripts which are executed with creation or deletion of an object of the corresponding class.
Learn more about scripts and configs in the article Scripts execution with object creation and deletion. |
Scripts, which are executed with object creation, also executed with cloning of object of the corresponding class. |
Below is a list of variables that can be passed as arguments in double braces like {{variable_name}}:
-
{{body}} - stringified object body,
-
{{class_id}} - object class,
-
{{client_data}} - data which affect object displaying in the native web interface:
-
information about collapsed sections in the Info modal window,
-
information about object css-styles,
-
array of names of properties which are displayed on the object,
-
array of IDs of graphs which are added to the joint graph,
-
array of widgets.
-
-
{{created}} - object creation time,
-
{{geoposition}} - geoposition,
-
{{geopositionRadius}} - geo radius on the map,
-
{{id}} or {{entityId}} - object ID,
-
{{last_state_update}} - time of the [last change of the object state,
-
{{name}} - object name,
-
{{parent_id}} - array of IDs of parent objects,
-
{{state_id}} - state ID,
-
{{tags}} - tags,
-
{{updated}} - time of the last change of the object.
It is also possible to pass object properties by their names: {{properties.property_name}}
Example:
With creation an object of the Host class, the script Emergence.sh is executed. The following is passed to the script as arguments:
-
the object name,
-
the object creation time.
With deletion an object of the Host class, the script Demolition.sh is executed. The following is passed to the script as arguments:
-
the object name,
-
the value of the IP property of the object.