CreateDCI
- CreateDCI(node, origin, name, description, dataType, pollingInterval, retentionTime): DCI
-
Create new data collection item on node, return DCI object instance of
nullif 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
nullfor server-default value.retentionTime
retention time in days,
0for "Do not save collected data to database" ornullfor server-default value.ReturnInstance of newly created DCI of
nullif failed.>>> d = CreateDCI($node, DataSource::AGENT, "Agent.Version", "Agent Version", DCI::STRING, 0, 0); >>> println(d.id); 145