You are viewing documentation for the development version, it may be incomplete.
Join our translation project and help translate Zabbix documentation into your native language.

proxy.get

説明

integer/array proxy.get(object parameters)

このメソッドは、指定されたパラメータに従ってプロキシを取得することができます。

このメソッドは、すべてのタイプのユーザーが利用できます。メソッドの呼び出し権限はユーザーロールの設定で取り消すことができます。詳細はユーザーロールを参照してください。

パラメータ

(object) 望ましい出力を定義するパラメータ。

このメソッドは以下のパラメータをサポートします。

パラメータ 説明
proxyids ID/array 指定したIDのプロキシのみを返します。
proxy_groupids ID/array 指定したプロキシグループに属するプロキシのみを返します。
selectAssignedHosts query プロキシに割り当てられているホストを持つassignedHostsプロパティを返します。

countをサポートします。
selectHosts query プロキシによって監視されているホストを持つhostsプロパティを返します。

countをサポートします。
selectProxyGroup query プロキシグループオブジェクトを持つproxyGroupプロパティを返します。
sortfield string/array 指定したプロパティで結果をソートします。

指定可能な値:proxyidnameoperating_mode
countOutput boolean これらのパラメータはリファレンス解説で説明されています。
editable boolean
excludeSearch boolean
filter object
limit integer
output query
preservekeys boolean
search object
searchByAny boolean
searchWildcardsEnabled boolean
sortorder string/array
startSearch boolean

戻り値

(integer/array) 次のいずれかを返します。

  • オブジェクトの配列
  • countOutputパラメータが使用されている場合は、取得したオブジェクトの数

すべてのプロキシを取得する

設定されているすべてのプロキシとそのインターフェースを取得します。

リクエスト:

{
           "jsonrpc": "2.0",
           "method": "proxy.get",
           "params": {
               "output": "extend"
           },
           "id": 1
       }

レスポンス:

{
           "jsonrpc": "2.0",
           "result": [
               {
                   "proxyid": "11",
                   "name": "Active proxy",
                   "proxy_groupid": "0",
                   "local_address": "",
                   "local_port": "10051",
                   "operating_mode": "0",
                   "description": "",
                   "allowed_addresses": "",
                   "address": "127.0.0.1",
                   "port": "10051",
                   "tls_connect": "1",
                   "tls_accept": "1",
                   "tls_issuer": "",
                   "tls_subject": "",
                   "custom_timeouts": "0",
                   "timeout_zabbix_agent": "",
                   "timeout_simple_check": "",
                   "timeout_snmp_agent": "",
                   "timeout_external_check": "",
                   "timeout_db_monitor": "",
                   "timeout_http_agent": "",
                   "timeout_ssh_agent": "",
                   "timeout_telnet_agent": "",
                   "timeout_script": "",
                   "last_access": "1693391880",
                   "version": "70000",
                   "compatibility": "1",
                   "state": "1"
               },
               {
                   "proxyid": "12",
                   "name": "Passive proxy",
                   "proxy_groupid": "1",
                   "local_address": "127.0.0.1",
                   "local_port": "10051",
                   "operating_mode": "1",
                   "description": "",
                   "allowed_addresses": "",
                   "address": "127.0.0.1",
                   "port": "10051",
                   "tls_connect": "1",
                   "tls_accept": "1",
                   "tls_issuer": "",
                   "tls_subject": "",
                   "custom_timeouts": "1",
                   "timeout_zabbix_agent": "5s",
                   "timeout_simple_check": "5s",
                   "timeout_snmp_agent": "5s",
                   "timeout_external_check": "5s",
                   "timeout_db_monitor": "5s",
                   "timeout_http_agent": "5s",
                   "timeout_ssh_agent": "5s",
                   "timeout_telnet_agent": "5s",
                   "timeout_script": "5s",
                   "lastaccess": "1693391875",
                   "version": "60400",
                   "compatibility": "2",
                   "state": "2"
               }
           ],
           "id": 1
       }

こちらもご参照ください

ソース

CProxy::get() in ui/include/classes/api/services/CProxy.php.