On this page
proxy.get
Description
integer/array proxy.get(object parameters)
The method allows to retrieve proxies according to the given parameters.
This method is available to users of any type. Permissions to call the method can be revoked in user role settings. See User roles for more information.
Parameters
(object) Parameters defining the desired output.
The method supports the following parameters.
| Parameter | Type | Description |
|---|---|---|
| proxyids | ID/array | Return only proxies with the given IDs. |
| proxy_groupids | ID/array | Return only proxies that belong to the given proxy groups. |
| selectAssignedHosts | query | Return an assignedHosts property with the hosts assigned to the proxy.Supports count. |
| selectHosts | query | Return a hosts property with the hosts monitored by the proxy.Supports count. |
| selectProxyGroup | query | Return a proxyGroup property with the proxy group object. |
| sortfield | string/array | Sort the result by the given properties. Possible values: proxyid, name, operating_mode. |
| countOutput | boolean | These parameters are described in the reference commentary. |
| editable | boolean | |
| excludeSearch | boolean | |
| filter | object | |
| limit | integer | |
| output | query | |
| preservekeys | boolean | |
| search | object | |
| searchByAny | boolean | |
| searchWildcardsEnabled | boolean | |
| sortorder | string/array | |
| startSearch | boolean |
Return values
(integer/array) Returns either:
- an array of objects;
- the count of retrieved objects, if the
countOutputparameter has been used.
Examples
Retrieve all proxies
Retrieve all configured proxies and their interfaces.
{
"jsonrpc": "2.0",
"method": "proxy.get",
"params": {
"output": "extend"
},
"id": 1
}
Response:
{
"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
}
See also
Source
CProxy::get() in ui/include/classes/api/services/CProxy.php.