GetAvgDCIValue

Deprecated in 6.2.

Please use getAverageValue() method of DCI class instead.

GetAvgDCIValue(object, dciId, periodStart, periodEnd): String

Get the average value of the DCI for the given period. The DCI value type must be numeric.

Table 1. Parameters

object

Instance of Node, Cluster, or MobileDevice object (e.g. $node).

dciId

ID of the DCI to retrive.

periodStart

Unix timestamp of the period start.

periodEnd

Unix timestamp of the period end.

Return

Average value (as String) or null on failure, if DCI is not found, is a table DCI, or there is no data for the period.

>>> obj = FindObject("Server1");
>>> dciId = FindDCIByName(obj, "CPU.Usage");
>>> val = GetAvgDCIValue(obj, dciId, 0, time()); // time range from January 1, 1970 untill now
>>> println("Average CPU Usage: ".. val .. "%");
Average CPU Usage: 17%