This method allows to calculate availability information about services该方法允许计算有关服务的可用性信息.

    Parameters 参数

    (object) Returns the following availability information about each service under the corresponding service ID返回相应服务ID下的每个服务下可用性信息.

    Property参数 Type类型 Description说明
    status integer Current status of the service服务的当前状态. Refer to the service object page for more information on service statuses.有关服务状态的更多信息,请参阅
    problems array Triggers that are currently in problem state and are linked either to the service or one of its descendants目前处于问题状态并与服务或其后相关联的触发器.
    sla array SLA data about each time period每个时间段的SLA数据. Each SLA object has the following properties每个SLA对象具有以下属性: - from - (timestamp) interval start time间隔开始时间; - - (timestamp) interval end time间隔结束时间; - sla - (float) SLA for the given time intervalSLA在给定的时间间隔; - okTime - (integer) time the service was in OK state, in seconds;时间服务处于OK状态,单位秒; - - (integer) time the service was in problem state, in seconds;时间服务处于问题状态,单位秒; - downtimeTime - (integer) time the service was in scheduled downtime, in seconds.在预定宕机时间的服务时间,单位秒

    Examples范例

    Retrieving availability information for an service检索服务的可用性信息

    Request请求:

    1. {
    2. "jsonrpc": "2.0",
    3. "result": {
    4. "2": {
    5. "status": "3",
    6. "problems": {
    7. "13904": {
    8. "expression": "{13359}=0",
    9. "description": "Service unavailable",
    10. "url": "",
    11. "status": "0",
    12. "value": "1",
    13. "priority": "3",
    14. "lastchange": "1352967420",
    15. "comments": "",
    16. "error": "",
    17. "templateid": "0",
    18. "type": "0",
    19. "value_flags": "0",
    20. "flags": "0"
    21. }
    22. "sla": [
    23. {
    24. "from": 1352452201,
    25. "to": 1353057001,
    26. "sla": 97.046296296296,
    27. "okTime": 586936,
    28. "problemTime": 17864,
    29. "downtimeTime": 0
    30. }
    31. ]
    32. }
    33. },
    34. "id": 1
    35. }

    Source源码

    CService::getSla() in frontends/php/include/classes/api/services/CService.php.