CalculateDowntime
- CalculateDowntime(object, tag, startTime, endTime): Array
-
Calculates total downtime within the specified time range from downtime records created by the Downtime Control EPP action. For a container-type object (an object that is not an event source), downtime is calculated separately for each of its direct child objects.
Table 1. Parameters object
NetObj or Integer
Network object or object ID
tag
String
Downtime tag (
defaultfor records created with an empty tag)startTime
Integer
Start of the period (as UNIX timestamp)
endTime
Integer
End of the period (as UNIX timestamp)
ReturnArray of DowntimeInfo objects (one per object), or
nullif the object is not found, is not accessible, or there are no matching downtime records.
// Calculate downtime for the last 24 hours
downtimes = CalculateDowntime($node, "default", time() - 86400, time());
if (downtimes != null) {
for (d : downtimes) {
println(d->object->name .. ": downtime " .. d->totalDowntime .. " seconds, uptime " .. d->uptimePercentage .. "%");
}
}