Collector

Object represents collector. Extends NetObj.

Instance attributes

Inherited from NetObj
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.

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 (null if zoning is disabled or backup proxy is not assigned)

backupZoneProxyId: int

ID of currently selected backup zone proxy (0 if 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 child objects. 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 ipAddress instead.

ipAddress ⇒ InetAddress

Added in version 5.1

Primary IP address.

isInMaintenanceMode: bool

Maintenance mode indicator (true if 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.

parents ⇒ array

List of direct parents for this object (most likely either Container or Cluster).

postcode: String

Postal address - postal code.

primaryZoneProxy: Node

currently selected primary zone proxy (null if zoning is disabled or primary proxy is not assigned)

primaryZoneProxyId: int

ID of currently selected primary zone proxy (0 if zoning is disabled or primary proxy is not assigned)

region: String

Postal address - region.

responsibleUsers: Array

Array with user objects that are added as responsible users for this object. Objects are User or UserGroup

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

Object type.

autoBindScript: String

Source of the script for automatic binding.

isAutoBindEnabled: bool

Indicate if automatic binding is enabled.

isAutoUnbindEnabled: bool

Indicate if automatic unbinding is enabled.

Instance methods

Inherited methods from NetObj
bind(childObject): void

Bind childObject to the current object as a child.

bindTo(parentObject): void

Bind current object to parentObject as a child.

calculateDowntime(tag, periodStart, periodEnd): Array

Calculate node downtime. Returns array of DowntimeInfo objects.

clearGeoLocation(): void

Clears GeoLocation data from the node.

createUserAgentNotification(message, startTime, endTime, showOnStartup): int

Send user agent notification. Returns message id.

delete(): void

Deletes current object.

deleteCustomAttribute(name): void

Delete custom attribute.

enterMaintenance(): void

Enable maintenance mode for the object.

expandString(string): String

Expand string by replacing macros with their values.

getCustomAttribute(name): String

Returns value of the custom attribute with the provided name.

getResponsibleUsers(tag) ⇒ array

Returns list of responsible users with specific tag.

isChild(object): bool

Returns TRUE if provided object is child of this object.

isDirectChild(object): bool

Returns TRUE if provided object is direct child of this object.

isDirectParent(object): bool

Returns TRUE if provided object is direct parent of this object.

isParent(object): bool

Returns TRUE if provided object is parent of this object.

leaveMaintenance(): void

Disable maintenance mode for the object.

manage(): void

Sets object to managed state.

readMaintenanceJournal(startTime, endTime): Array

Read maintenance entries. Returns array of MaintenanceJournalRecord objects.

rename(name): void

Rename object.

setAlias(name): void

Set object alias name.

setCategory(idOrName): void

Set object category id or name.

setComments(comment, [isMarkdown]): void

Set object comments.

setCustomAttribute(key, value, inherit=false): void

Update or create custom attribute.

setGeoLocation(newLocation): void

Sets node geographical location.

setMapImage(image): void

Sets object image for network map display.

setNameOnMap(name): void

Sets object’s name for network map display.

setStatusCalculation(type, …​): void

Sets status calculation method.

setStatusPropagation(type, …​): void

Sets status propagation method.

unbind(object): void

Unbind provided object from the current object.

unbindFrom(object): void

Unbind current object from the provided object.

unmanage(): void

Set object into unmanaged state.

writeMaintenanceJournal(description): void

Add entry to maintenance journal.

createCollector(name) ⇒ Collector

Create new collector under current object

Table 1. Parameters

name

String

New collector’s name

Return

Newly created collector of Collector class.

createContainer(name) ⇒ Container

Create new container under current object

Table 2. Parameters

name

String

New container’s name

Return

Newly created container of Container class.

createNode(name, primaryHostName, zoneUIN) ⇒ Node

Create new node under current object.

Table 3. Parameters

name

String

Node name if second options is set or primary host name or IP address.

primaryHostName

String

Optional. Primary host name or IP address.

zoneUIN

Integer

Optional. New node’s zone UIN.

Return

Newly created node of Node class or NULL if failed to create

createSensor(name, deviceClass, gateway, modbusUnitId) ⇒ Sensor

Create new sensor under current object.

Table 4. Parameters

name

String

Sensor name

deviceClass

Integer

Sensor device class, one of the following values. Optional, SensorDeviceClass::Other if omitted.

gateway

NetObj

Gateway used for communication sensor. Optional.

modbusUnitId

Integer

MODBUS Unit ID. Optional.

Return

Newly created sensor of Sensor class or NULL if failed to create

setAutoBindMode(enableBind, enableUnbind): void

Set automatic bind mode for the container.

Table 5. Parameters

enableBind

Boolean

Script should be used for automatic binding.

enableUnbind

Boolean

Script should be used for automatic unbinding.

setAutoBindScript(script): void

Update automatic binding script source.

Table 6. Parameters

script

String

Script source.