2022 Zabbix中国峰会
2022 Zabbix中国峰会

dcheck.get

描述

integer/array dcheck.get(object parameters)

The method allows to retrieve discovery checks according to the given parameters.

该方法可以根据给定的参数检索发现检查

参数

(object) 定义希望输出的参数.

该方法支持如下参数.

参数 类 描述
dcheckids string/array Return only discovery checks with the given IDs. 返回给定ID的发现检查
druleids string/array Return only discovery checks that belong to the given discovery rules. 返回属于给定发现规则的发现检查
dserviceids string/array Return only discovery checks that have detected the given discovered services.返回探测到发现服务的发现检查
sortfield string/array Sort the result by the given properties. 根据给定的属性排序.

可能的值: dcheckiddruleid.
countOutput flag These parameters being common for all get methods are described in detail in the reference commentary. 下面这些参数的get方法在reference commentary里面有详细说明
editable boolean
excludeSearch flag
filter object
limit integer
output query
preservekeys flag
search object
searchByAny boolean
searchWildcardsEnabled boolean
sortorder string/array
startSearch flag

返回值

(integer/array) 返回:

  • 对象数组;
  • 如果使用了countOutput参数,将返回对象的计数.

例子

Retrieve discovery checks for a discovery rule 获取发现规则的发现检查

Retrieve all discovery checks used by discovery rule "6".

获取被发现规则"6"使用的发现检查.

请求:

{
           "jsonrpc": "2.0",
           "method": "dcheck.get",
           "params": {
               "output": "extend",
               "dcheckids": "6"
           },
           "auth": "038e1d7b1735c6a5436ee9eae095879e",
           "id": 1
       }

响应:

{
           "jsonrpc": "2.0",
           "result": [
               {
                   "dcheckid": "6",
                   "druleid": "4",
                   "type": "3",
                   "key_": "",
                   "snmp_community": "",
                   "ports": "21",
                   "snmpv3_securityname": "",
                   "snmpv3_securitylevel": "0",
                   "snmpv3_authpassphrase": "",
                   "snmpv3_privpassphrase": "",
                   "uniq": "0",
                   "snmpv3_authprotocol": "0",
                   "snmpv3_privprotocol": "0"
               }
           ],
           "id": 1
       }

来源

CDCheck::get() in frontends/php/include/classes/api/services/CDCheck.php.