GetAvgDCIValue

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

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 or null on failure.

>>> 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%