CreateDCI

CreateDCI(node, origin, name, description, dataType, pollingInterval, retentionTime): DCI

Create new data collection item on node, return DCI object instance of null if failed.

Table 1. Parameters

node

Node object instance (e.g. $node), where DCI should be created.

origin

Data origin. Possible values: "agent", "snmp", "internal", "push", "websvc", "winperf", "script", "ssh", "mqtt", "driver", "cpsnmp". Alternatively, you can use Data origin constants.

name

name of the metric (e.g. "Agent.Version")

description

human readable description.

dataType

Type of the collected data. Possible values: "int32", "uint32", "int64", "uint64", "counter32", "counter64", "float", "string". Alternatively, you can use DCI data type constants.

pollingInterval

polling interval in seconds or null for server-default value.

retentionTime

retention time in days, 0 for "Do not save collected data to database" or null for server-default value.

Return

Instance of newly created DCI of null if failed.

>>> d = CreateDCI($node, DataSource::AGENT, "Agent.Version", "Agent Version", DCI::STRING, 0, 0);
>>> println(d.id);
145