CloudDomain
Represents cloud domain: an account or a project in a cloud provider (for example, AWS account or Azure subscription) monitored through a cloud connector. Cloud resources discovered in the domain are represented by Resource objects placed under the domain. Extends DataCollectionTarget.
Instance attributes
- aiHint: String
-
Hint for AI anomaly profile generation.
- alarms ⇒ array
-
List of active Alarms for this object.
- alarmStats ⇒ array
-
Integer array that consists of 5 numbers - each number represents number of alarms for this and child objects for each of severity.
- alias: String
-
Object alias. For interfaces it is automatically collected on configuration poll (e.g. from SNMP ifAlias).
- asset ⇒ Asset
-
Reference to asset class of asset linked to this object.
nullif no asset is linked or the script has no read access to the asset.
- assetId: int
-
Id of linked asset object.
- assetProperties ⇒ AssetProperties
-
Reference to asset properties class of asset linked to this object.
- backupZoneProxy: Node
-
Currently selected backup zone proxy (
nullif zoning is disabled, backup proxy is not assigned, or the script has no read access to the proxy node)
- backupZoneProxyId: int
-
ID of currently selected backup zone proxy (
0if zoning is disabled or backup proxy is not assigned)
- category: String
-
Object’s category name
- categoryId: int
-
Object’s category ID
- children ⇒ array
-
List of direct child objects. Only objects the script has read access to are included. Use classof to differentiate.
- city: String
-
Postal address - city.
- comments: String
-
Object comments.
- country: String
-
Postal address - country.
- creationTime: int64
-
Object creation time as UNIX timestamp
- customAttributes ⇒ HashMap
-
Hash map of object custom attributes.
- district: String
-
Postal address - district.
- geolocation ⇒ GeoLocation
-
Object geographical location.
- guid: String
-
Object GUID as
string.
- id: int
-
Unique object identifier.
- ipAddr: String
-
Primary IP address. Deprecated and will be removed in a future version, use
ipAddressinstead.
- ipAddress ⇒ InetAddress
-
Primary IP address.
- isInMaintenanceMode: bool
-
Maintenance mode indicator (
trueif object currently is in maintenace mode).
- maintenanceInitiator: int
-
Maintenance initiator user id
- mapImage: String
-
GUID of object image used for representation on the maps.
- name: String
-
Object name.
- nameOnMap: String
-
Object name displayed on map.
- postcode: String
-
Postal address - postal code.
- primaryZoneProxy: Node
-
currently selected primary zone proxy (
nullif zoning is disabled, primary proxy is not assigned, or the script has no read access to the proxy node)
- primaryZoneProxyId: int
-
ID of currently selected primary zone proxy (
0if zoning is disabled or primary proxy is not assigned)
- region: String
-
Postal address - region.
- state: int
-
Current object state. One of: Node State, Cluster State, Sensor State
- status: int
-
Current object status.
- streetAddress: String
-
Postal address - street.
- type: int
- templates: Array
-
Returns array of templates (Template) applied on this object. Only templates the script has read access to are included. Return value also affected by trusted nodes settings.
// Log names and ids of all accessible templates for current node templates = $node.templates; for (t : templates) { trace(1, "Template object: name='" .. t.name .. "' id=" .. t.id); }
- connectorName: String
-
Name of the cloud connector used for this domain.
- gracePeriod: int
-
Grace period in days. Used with removalPolicy
1: resource that is no longer reported by the cloud provider is deleted after it has been missing for this many days. Default is 30.
- lastDiscoveryStatus: int
-
Status of the last resource discovery:
0if discovery completed successfully, non-zero if it failed (for example, connector not found or discovery returned no results).
- lastDiscoveryTime: int64
-
UNIX timestamp of the last resource discovery, or
0if discovery was never run.
- removalPolicy: int
-
What to do with resources that are no longer reported by the cloud provider:
-
0: mark resource as inactive
-
1: mark resource as inactive and delete it after gracePeriod days
-
2: delete resource immediately
-
3: ignore (keep resource unchanged)
-
Instance methods
- bind(childObject): void
-
Bind
childObjectto the current object as a child.Table 1. Parameters childObject
Object to bind as a child to the current object.
Returnfalseif the script lacks modify access to the current object; otherwisenull, whether or not the link was made. Invalid object types, incompatible bindings and bindings that would create a loop cause a runtime error.
- bindTo(parentObject): void
-
Bind current object to
parentObjectas a child.Table 2. Parameters parentObject
Object to bind as a parent to the current object.
Returnfalseif the script lacks modify access to the current object; otherwisenull, whether or not the link was made. Invalid object types, incompatible bindings and bindings that would create a loop cause a runtime error.
- calculateDowntime(tag, periodStart, periodEnd): Array
-
Calculate node downtime
Table 3. Parameters tag
String
downtime tag
periodStart
Integer
Unix timestamp of the period start
periodEnd
Integer
Unix timestamp of the period end
ReturnArray of DowntimeInfo objects, or
nullif no downtime was recorded for the tag in the period.
- clearGeoLocation(): void
-
Clears GeoLocation data from the node
- createUserAgentNotification(message, startTime, endTime, showOnStartup=false): int
-
Send a User Support Application notification to the nodes at or below this object. Set
startTimeandendTimeto0for an instant notification. See User Support Application Notifications.Table 4. Parameters message
String
message to be sent
startTime
Integer
start time of message delivery (UNIX timestamp)
endTime
Integer
end time of message delivery (UNIX timestamp)
showOnStartup
Boolean
TRUEto show message on startup (optional, defaults to false)ReturnMessage id.
- delete(): void
-
Deletes current object.
- deleteCustomAttribute(name): String
-
Delete custom attribute.
Table 5. Parameters name
String
Name of the attribute to delete.
ReturnPrevious value of the attribute, or
nullif it did not exist. Stored values"true"and"false"are returned as boolean.falseis also returned if the script has no modify access to the object (see access check), so it is ambiguous; read the attribute back to check whether it was deleted.
- enterMaintenance([comment]): void
-
Enable maintenance mode for the object.
Table 6. Parameters comment
String
Optional. Maintenance comment, recorded with the maintenance mode change.
- expandString(string): String
-
Expand string by replacing macros with their values.
Table 7. Parameters string
String
String to expand
ReturnFormated string
>>> $node.expandString("%n") My node name
- forceAutobindPoll(): bool
-
Schedule forced autobind poll for this object. The poll is executed asynchronously on the poller thread pool; the method returns immediately after scheduling.
ReturnTRUEif the poll was scheduled,FALSEif the caller has no modify access to the object or autobind poll is not applicable to this object type.
- forceConfigurationPoll(): bool
-
Schedule forced configuration poll for this object. The poll is executed asynchronously on the poller thread pool; the method returns immediately after scheduling.
ReturnTRUEif the poll was scheduled,FALSEif the caller has no modify access to the object or configuration poll is not applicable to this object type.// Re-read node configuration after changing its SNMP settings $node.setSNMPCommunity("public"); if (!$node.forceConfigurationPoll()) println("Cannot schedule configuration poll");
- forceDiscoveryPoll(): bool
-
Schedule forced network discovery poll for this object. The poll is executed asynchronously on the poller thread pool; the method returns immediately after scheduling.
ReturnTRUEif the poll was scheduled,FALSEif the caller has no modify access to the object or network discovery poll is not applicable to this object type.
- forceInstanceDiscoveryPoll(): bool
-
Schedule forced instance discovery poll for this object. The poll is executed asynchronously on the poller thread pool; the method returns immediately after scheduling.
ReturnTRUEif the poll was scheduled,FALSEif the caller has no modify access to the object or instance discovery poll is not applicable to this object type.
- forceMapUpdatePoll(): bool
-
Schedule forced map update poll for this object. The poll is executed asynchronously on the poller thread pool; the method returns immediately after scheduling.
ReturnTRUEif the poll was scheduled,FALSEif the caller has no modify access to the object or map update poll is not applicable to this object type.
- forceRoutingTablePoll(): bool
-
Schedule forced routing table poll for this object. The poll is executed asynchronously on the poller thread pool; the method returns immediately after scheduling.
ReturnTRUEif the poll was scheduled,FALSEif the caller has no modify access to the object or routing table poll is not applicable to this object type.
- forceStatusPoll(): bool
-
Schedule forced status poll for this object. The poll is executed asynchronously on the poller thread pool; the method returns immediately after scheduling.
ReturnTRUEif the poll was scheduled,FALSEif the caller has no modify access to the object or status poll is not applicable to this object type.
- forceTopologyPoll(): bool
-
Schedule forced topology poll for this object. The poll is executed asynchronously on the poller thread pool; the method returns immediately after scheduling.
ReturnTRUEif the poll was scheduled,FALSEif the caller has no modify access to the object or topology poll is not applicable to this object type.
- getCustomAttribute(name): String
-
Returns value of the custom attribute with the provided name.
Table 8. Parameters name
String
Name of the attribute to get value from.
ReturnAttribute value, or
nullif the attribute does not exist. Stored values"true"and"false"are returned as boolean.Alternatively, attributes can be accessed as instance attribues (with
., attribute should exist) or by usingattribute@objectnotion (which will returnnullinstead of runtime error if attribue is missing).
- getResponsibleUsers(tag) ⇒ array
-
Returns list of responsible users with specific tag. Full list is acceessible via .responsibleUsers
List of allowed tags are controlled by server configuration variable
Objects.ResponsibleUsers.AllowedTags.Table 9. Parameters tag
String
Tag.
nullreturns all responsible users, same as.responsibleUsers.ReturnArray with user objects that are added as responsible users for this object. Objects are User or UserGroup
This function return empty list if no users or groups are found for the tag.
- isChild(object): bool
-
If provided object is child of this object
Table 10. Parameters object
Object to check
ReturnTRUE if provided object is child of this object
- isDirectChild(object): bool
-
If provided object is direct child of this object
Table 11. Parameters object
Object to check
ReturnTRUE if provided object is direct child of this object
- isDirectParent(object): bool
-
If provided object is direct parent of this object
Table 12. Parameters object
Object to check
ReturnTRUE if provided object is direct parent of this object
- isParent(object): bool
-
If provided object is parent of this object
Table 13. Parameters object
Object to check
ReturnTRUE if provided object is parent of this object
- leaveMaintenance(): void
-
Disable maintenance mode for the object.
- manage(): void
-
Sets object to managed state. Has no affect if object already managed. Returns
falseand does not change the state if the object is a decommissioned node. Since 6.2.6
- readMaintenanceJournal([startTime], [endTime]): Array
-
Read maintenance entries
Table 14. Parameters startTime
Integer
Optional. Period start as UNIX timestamp.
0or omitted means no lower bound.endTime
Integer
Optional. Period end as UNIX timestamp.
0or omitted means no upper bound.ReturnArray with MaintenanceJournalRecord objects, or
nullon database error
- rename(name): void
-
Rename object.
Table 15. Parameters name
String
New object name
- setAlias(name): void
-
Set object alias name
Table 16. Parameters name
String
New alias name
- setCategory(idOrName): bool
-
Set object category id or name (used to get object display image)
Table 17. Parameters idOrName
String
ID or name of category
ReturnTRUEon success,FALSEif the category is not found or the caller has no modify access to the object.
- setComments(comment, [isMarkdown]): void
-
Set object comments
Table 18. Parameters comment
String
Comment to be set
isMarkdown
Boolean
Optional second argument ( v 5.1.2 ). If it is logical "true", Markdown indicator will be added if not present already; if it is logical "false" (but not NULL), Markdown indicator will be removed if present; if it is NULL or omitted, comment will be set as is (retaining existing behavior).
- setCustomAttribute(key, value, [inherit]): String
-
Update or create custom attribute with the given key and value.
Table 19. Parameters key
String
Attribute key
value
String
Attribute value
inherit
Boolean
Optional parameter. If not set - inheritance will not be changed.
trueto inherit,falsenot to inherit.ReturnPrevious value of the attribute, or
nullif it did not exist. Stored values"true"and"false"are returned as boolean.falseis also returned if the script has no modify access to the object (see access check), so it is ambiguous; read the attribute back to check whether it was set.$node.setCustomAttribute("location", "Rack 12"); if ($node.getCustomAttribute("location") != "Rack 12") println("Cannot set custom attribute");
- setGeoLocation(newLocation): void
-
Sets node geographical location.
Table 20. Parameters newLocation
- setMapImage(image): bool
-
Sets object image, that will be used to display object on network map
Table 21. Parameters image
String
GUID or name of image from image library.
nullor all-zero GUID resets the image.ReturnTRUEon success,FALSEif the image is not found in image library or the caller has no modify access to the object.
- setNameOnMap(name): void
-
Sets object’s name, that will be used to display object on network map
Table 22. Parameters name
String
New object’s name on map
- setPostalAddress(country, region, city, district, streetAddress, postcode): void
-
Sets object’s postal address. Each argument must be a string or
null. Anullor empty value clears the corresponding field.Table 23. Parameters country
String
Country.
nullor empty to clear.region
String
Region.
nullor empty to clear.city
String
City.
nullor empty to clear.district
String
District.
nullor empty to clear.streetAddress
String
Street address.
nullor empty to clear.postcode
String
Postal code.
nullor empty to clear.
- setStatusCalculation(type, …): int
-
Sets status calculation method.
Table 24. Parameters type
Integer
Status calculation type. One of status calculation types
…
Integer(s)
If single threshold or multiple thresholds type is selected, then threshold or thresholds in percentage should be provided as next parameters.
Return1on success,0iftypeis not a valid status calculation type.falseif the caller has no modify access to the object.
- setStatusPropagation(type, …): int
-
Sets status propagation method.
Table 25. Parameters type
Integer
Status propagation type. One of status propagation types
…
Integer(s)
For fixed value type - value (object status) should be provided. For relative - offset should be provided. For translated - status mapping should be provided (4 numbers: object status to propagate for Warning, Minor, Major and Critical).
Return1on success,0iftypeis not a valid status propagation type.falseif the caller has no modify access to the object.
- unbind(object): void
-
Unbind provided object from the current object.
Table 26. Parameters object
Object to unbind from the current object.
- unbindFrom(object): void
-
Unbind current object from the provided object.
Table 27. Parameters object
Object to unbind from the current object.
- unmanage(): void
-
Set object into unmanaged state. Has no effect if object is already in unmanaged state.
- writeMaintenanceJournal(description): bool
-
Add entry to maintenance journal
Table 28. Parameters description
String
Message to be added
ReturnTRUEif the entry was added,FALSEon failure or if the caller has no maintenance access to the object.
- applyTemplate(template): bool
-
Apply template to this object.
Table 29. Parameters template
Template object to apply
Returntrueif template was applied,falseif a template from the same exclusion group is already applied to this object or the caller has no modify access to the object. Since 6.2.3
- createDCI(origin, name, description, dataType, [pollingInterval], [retentionTime]) ⇒ DCI
-
Create a new data collection item on this object.
Table 30. Parameters origin
String or Integer
Data origin. Possible values:
"internal","agent","snmp","websvc","push","winperf","smclp","script","ssh","mqtt","driver","modbus","ethernetip"(case-insensitive). Alternatively, you can use Data origin constants.name
String
Name of the metric (e.g.
"Agent.Version").description
String
Human readable description.
dataType
String or Integer
Type of the collected data. Possible values:
"int32","uint32","int64","uint64","counter32","counter64","float","string". Alternatively, you can use DCI data type constants.pollingInterval
String
Polling interval in seconds, or
nullor"0"for server-default value. Optional.retentionTime
String
Retention time in days,
"0"for "Do not save collected data to database", ornullfor server-default value. Optional.ReturnNewly created DCI object, or
nullif origin or data type is invalid or the caller has no modify access to the object.dci = $node.createDCI("agent", "Agent.Version", "Agent Version", "string"); println(dci.id);
- deleteDCI(dciId): bool
-
Delete data collection item from this object. DCIs created from a template are managed by that template and cannot be deleted this way.
Table 31. Parameters dciId
Integer
DCI ID.
Returntrueon success,falseon failure (caller has no modify access to the object, DCI not found, or DCI was created from a template).dci = $node.findDCIByName("Temporary.Metric"); if (dci != null) $node.deleteDCI(dci.id);
- enableConfigurationPolling(flag): void
-
Enable or disable configuration polling.
Table 32. Parameters flag
Boolean
If configuration polling should be enabled.
- enableDataCollection(flag): void
-
Enable or disable data collection polling.
Table 33. Parameters flag
Boolean
If data collection polls should be enabled.
- enableStatusPolling(flag): void
-
Enable or disable status polling.
Table 34. Parameters flag
Boolean
If status polls should be enabled.
- findAllDCIs(name, description, tag, relatedObject): Array
-
Find all DCIs on this object matching the given filters. All parameters are optional; omitted or
nullparameters are not used for filtering. Name, description, and tag filters support glob patterns (?and*) and are case-insensitive.Table 35. Parameters name
String
Name filter (glob pattern). Optional.
description
String
Description filter (glob pattern). Optional.
tag
String
User tag filter (glob pattern). Optional.
relatedObject
NetObj or Integer
Related object or object ID. Optional.
ReturnArray of DCI objects matching the filters.
// Find all CPU-related DCIs for (d : $node.findAllDCIs("System.CPU.*")) println(d.name .. " = " .. d.cachedValue);
- findDCIByName(name) ⇒ DCI
-
Find a DCI on this object by metric name (exact case-insensitive match).
Table 38. Parameters name
String
Metric name of the DCI.
ReturnDCI object or
nullif not found.dci = $node.findDCIByName("System.CPU.Usage"); if (dci != null) println("CPU Usage: " .. dci.cachedValue);
- pushDCIData(dciId, value, [timestamp]): bool
-
Push a new value to a DCI from script. The DCI must be a single value DCI with origin set to "Push" or "OpenTelemetry (OTLP)".
Table 41. Parameters dciId
Integer
DCI ID.
value
String
New value for the DCI.
timestamp
Integer
Timestamp in milliseconds since epoch (1 Jan 1970 00:00:00 UTC). Optional, current time is used if not specified.
Returntrueon success,falseon failure (DCI not found, wrong origin, not a single value DCI, or value was not accepted).dci = $node.findDCIByName("My.Push.Metric"); $node.pushDCIData(dci.id, "42");
- readInternalParameter(name): String
-
Reads object internal metric (metric with source "Internal").
Table 42. Parameters name
String
Metric name.
ReturnMetric value, or
nullif the metric cannot be read.
- removeTemplate(template): void
-
Remove template from this object.
Table 43. Parameters template
Template object to remove
// Report cloud domain with failed discovery
domain = FindObject("Production AWS");
if ((domain != null) && (domain.lastDiscoveryStatus != 0))
println("Discovery failed for " .. domain.name .. " (connector " .. domain.connectorName .. ")");