Difference between revisions of "NXSL:CreateDCI"

From NetXMS Wiki
Jump to navigation Jump to search
(Created page with "__NOTOC__ Create new DCI. '''Since:''' 1.2.6 == Syntax == CreateDCI(''node'',''source'',''name'',''description'',''dataType'',''pollingInterval'',''retentionTime''); == P...")
 
m (Text replacement - "^" to "{{deprecated}}")
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
__NOTOC__
{{deprecated}}__NOTOC__
Create new DCI.
Create new DCI.


Line 6: Line 6:
== Syntax ==
== Syntax ==


CreateDCI(''node'',''source'',''name'',''description'',''dataType'',''pollingInterval'',''retentionTime'');
CreateDCI(''node'', ''source'', ''name'', ''description'', ''dataType'', ''pollingInterval'', ''retentionTime'');




== Parameters ==
== Parameters ==
 
:{| class="wikitable"
:{|
|-
|-
| ''node'' || [[NXSL:Node|Node]] object to create DCI on.
| ''node'' || [[NXSL:Node|Node]] object to create DCI on.
|-
|-
| ''source'' || Data collection source. Should be on of:
| ''source'' || Data collection source. Should be on of:
{|
:{| class="wikitable"
|-
|-
| "agent" || source is NetXMS agent.
| "agent" || source is NetXMS agent.
|-
| "driver" || source is network device driver.
|-
|-
| "internal" || source is server's internal data.
| "internal" || source is server's internal data.
|-
|-
| "push" || source is push agent.
| "push" || source is push agent.
|-
| "script" || source is NXSL script.
|-
|-
| "snmp" || source is SNMP agent.
| "snmp" || source is SNMP agent.
|-
| "ssh" || source is SSH command.
|-
| "winperf" || source is Windows performance counter.
|}
|}
|-
|-
Line 32: Line 39:
|-
|-
| ''dataType'' || DCI data type. Should be one of:
| ''dataType'' || DCI data type. Should be one of:
{|
:{| class="wikitable"
|-
|-
| "int32" || signed 32-bit integer.
| "int32" || signed 32-bit integer.
Line 54: Line 61:
== Return Value ==
== Return Value ==


[[NXSL:DCI|DCI]] object on success or null on failure.
[[NXSL:DCI|DCI]] object on success or '''null''' on failure.


== Examples ==
== Examples ==

Latest revision as of 18:13, 13 September 2022

This Wiki is deprecated and we are are currrently migrating remaining pages into product documentation (Admin Guide, NXSL Guide)

Create new DCI.

Since: 1.2.6

Syntax

CreateDCI(node, source, name, description, dataType, pollingInterval, retentionTime);


Parameters

node Node object to create DCI on.
source Data collection source. Should be on of:
"agent" source is NetXMS agent.
"driver" source is network device driver.
"internal" source is server's internal data.
"push" source is push agent.
"script" source is NXSL script.
"snmp" source is SNMP agent.
"ssh" source is SSH command.
"winperf" source is Windows performance counter.
name Metric name (parameter for agent and internal DCIs, OID for SNMP).
description Textual description of the DCI.
dataType DCI data type. Should be one of:
"int32" signed 32-bit integer.
"uint32" unsigned 32-bit integer.
"int64" signed 64-bit integer.
"uint64" unsigned 64-bit integer.
"float" floating point number.
"string" text string.
pollingInterval Interval in seconds between polls.
retentionTime DCI retention time in days.

Return Value

DCI object on success or null on failure.

Examples

// Create DCI to collect agent's version every 300 seconds and
// keep history for 370 days on node named "SERVER"
node = FindNodeObject(null, "SERVER");
if (node != null)
{
	dci = CreateDCI(node, "agent", "Agent.Version", "Version of NetXMS agent", "string", 300, 370);
	println (dci != null) ? "DCI created" : "DCI creation failed";
}
else
{
	println "Cannot find node object";
}