Skip to content

Proxy

add_proxy_to_group

add_proxy_to_group <NAME_OR_ID> <PROXY_GROUP> <LOCAL_ADDRESS> <LOCAL_PORT>

Add a proxy to a proxy group.

Requires a local address and port for active agent redirection if if the proxy does not have it set.

Examples

Add a proxy to a proxy group

add_proxy_to_group proxy1 group1 192.168.0.2 10051

Arguments

NAME_OR_ID
Name or ID of proxy to add.
Type: text
Required:

PROXY_GROUP
Name or ID of proxy group to add proxy to.
Type: text
Required:

LOCAL_ADDRESS
Address for active agents.
Type: text
Required:

LOCAL_PORT
Address for active agents.
Type: text
Required:


clear_host_proxy

clear_host_proxy <HOSTNAME> [OPTIONS]

Clear the proxy for one or more hosts.

Sets the hosts to be monitored by the Zabbix server instead of a proxy.

Arguments

HOSTNAME
Hostnames. Comma-separated Supports wildcards.
Type: text
Required:

Options

--dryrun/--no-dryrun
Preview changes
Type: boolean (flag)
Default: False


load_balance_proxy_hosts

load_balance_proxy_hosts <<PROXY1,PROXY2,...>> <[WEIGHT1,WEIGHT2,...]>

Spread hosts between multiple proxies.

Hosts are determined by the hosts monitored by the given proxies Hosts monitored by other proxies or not monitored at all are not affected.

Weighting for the load balancing is optional, and defaults to equal weights. Number of proxies must match number of weights if specified.

Examples

Load balance hosts evenly between two proxies

load_balance_proxy_hosts proxy1,proxy2

Place twice as many hosts on proxy1 as proxy2

load_balance_proxy_hosts proxy1,proxy2 2,1

Load balance hosts evenly between three proxies

load_balance_proxy_hosts proxy1,proxy2,proxy3

Load balance hosts unevenly between three proxies

load_balance_proxy_hosts proxy1,proxy2,proxy3 1,1,2

Arguments

<proxy1,proxy2,...>
Comma delimited list of proxies to share hosts between.
Type: text
Required:

[weight1,weight2,...]
Weights for each proxy. Comma-separated. Defaults to equal weights.
Type: text


move_proxy_hosts

move_proxy_hosts <PROXY_SRC> <PROXY_DST> [OPTIONS]

Move hosts from one proxy to another.

Examples

Move all hosts from one proxy to another

move_proxy_hosts proxy1 proxy2

Move all hosts with names matching a regex pattern

move_proxy_hosts proxy1 proxy2 --filter '$www.*'

Arguments

PROXY_SRC
Proxy to move hosts from.
Type: text
Required:

PROXY_DST
Proxy to move hosts to.
Type: text
Required:

Options

--filter <HOST_FILTER>
Regex pattern of hosts to move.
Type: text


remove_proxy_from_group

remove_proxy_from_group <NAME_OR_ID>

Remove a proxy from a proxy group.

Arguments

NAME_OR_ID
Name or ID of proxy to remove.
Type: text
Required:


show_proxies

show_proxies <NAME_OR_ID> [OPTIONS]

Show all proxies.

Shows number of hosts for each proxy unless --hosts is passed in, in which case the hostnames of each host is displayed instead.

Arguments

NAME_OR_ID
Filter by proxy name or ID. Comma-separated. Supports wildcards.
Type: text

Options

--hosts
Show hostnames of each host.
Type: boolean (flag)
Default: False


show_proxy_group_hosts

show_proxy_group_hosts <PROXYGROUP>

Show all hosts in a proxy group.

Arguments

PROXYGROUP
Proxy group name or ID. Supports wildcards.
Type: text
Required:


show_proxy_groups

show_proxy_groups <NAME_OR_ID> [OPTIONS]

Show all proxy groups and their proxies.

Optionally takes in a list of names or IDs to filter by.

Examples

Show all proxy groups

show_proxy_groups

Show proxy groups with a specific proxy

show_proxy_groups --proxy proxy1

Show proxy groups with either proxy1 or proxy2

show_proxy_groups --proxy proxy1,proxy2

Arguments

NAME_OR_ID
Filter by proxy name or ID. Comma-separated. Supports wildcards.
Type: text

Options

--proxy <PROXIES>
Show only groups containing these proxies. Comma-separated.
Type: text


update_host_proxy

update_host_proxy <HOSTNAME> <PROXY> [OPTIONS]

Assign hosts to a proxy.

Supports wildcards for both hosts and proxy names. If multiple proxies match the proxy name, the first match is used.

Arguments

HOSTNAME
Hostnames. Comma-separated Supports wildcards.
Type: text
Required:

PROXY
Proxy name. Supports wildcards.
Type: text
Required:

Options

--dryrun/--no-dryrun
Preview changes
Type: boolean (flag)
Default: False


update_hostgroup_proxy

update_hostgroup_proxy <HOSTGROUP> <PROXY> [OPTIONS]

Assign a proxy to all hosts in one or more host groups.

Arguments

HOSTGROUP
Host group(s). Comma-separated. Supports wildcards.
Type: text
Required:

PROXY
Proxy to assign. Supports wildcards.
Type: text
Required:

Options

--dryrun/--no-dryrun
Preview changes.
Type: boolean (flag)
Default: False


update_hostgroup_proxygroup

update_hostgroup_proxygroup <HOSTGROUP> <PROXYGROUP> [OPTIONS]

Assign a proxy group to all hosts in one or more host groups.

Arguments

HOSTGROUP
Host group(s). Comma-separated. Supports wildcards.
Type: text
Required:

PROXYGROUP
Proxy group to assign. Supports wildcards.
Type: text
Required:

Options

--dryrun/--no-dryrun
Preview changes.
Type: boolean (flag)
Default: False