Skip to main content

No project description provided

Project description

1. Zabbix CLI

1.1 Example

1.1.1 Valid Command

zabbix_controller -u username -p password hosts list
zabbix_controller -u username -p password hosts -m name:^server$ list

1.1.2 Invalid Command

zabbix_controller hosts -u username -p password list
zabbix_controller -u username -p password hosts list -m name:^server$

1.2 zabbixctl [options] command ...

1.2.1 Options

These options are only set at zabbixctl [options] command .... zabbixctl command [options] ... is not accepted.

1.2.1.1 --help

zabbixctl --help

1.2.1.2 --apiserver-address, -aa

zabbixctl -aa http://localhost:8081

1.2.1.3 --username, -u, --password, -p

Used for zabbix login

zabbixctl --username Admin --password zabbix_password

1.2.1.4 --basicauth_username, -bu, --basicauth_password, -bp

Used for basic authentication

zabbixctl -bu alis -bp alis_password

1.2.1.5 --dry-run

If you set --dry-run, only get API is executed, then ZabbixCTL state is printed. Create, update, delete like API is not executed.

zabbixctl --dry-run

1.3 zabbixctl host Options Command ...

1.3.1 Options

1.3.1.1 -m, --match

Search host using json like object. Search key, then apply value. In the example below, hosts which name key is including some_name are listed.

zabbixctl hosts -m '{"name": "some_name"}' list
zabbixctl hosts -m '[{"name": "some_name"}]' list

Each key, value pairs are chained by and operator. Each dicts are chained by or operator.

This command mean ("name": "some_name" and "hostid": "^1") or "name": "other_name".

zabbixctl hosts -m '[{"name": "some_name", "hostid": "^1"}, {"name": "other_name"}]' list

1.3.1.2 -tr, --time-range

This option is able to specify time range. If you use --match at the same time, used by "and operator".

key:[from]-[to]

from and to must be unixtime and can be omitted. These commands are same and print host which disable property is included from 0 to now.

zabbixctl hosts -tr disable:0- list
zabbixctl hosts -tr disable:- list

This command mean (("name": "some_name" and "hostid": "^1") or "name": "other_name") and (0 <= disable_until <= now).

zabbixctl hosts -m '[{"name": "some_name", "hostid": "^1"}, {"name": "other_name"}]' -tr 'disable_until:-' list

1.3.2 Commands

1.3.2.1 list

list up host

1.3.2.2 delete

delete host

  • options
    • -y, --yes
zabbixctl hosts -m '{"name": "some_name"}' delete -y

1.3.2.3 disable

disable host

  • options
    • -y, --yes
zabbixctl hosts -m '{"name": "some_name"}' disable -y

1.3.2.4 update

update host

  • options
    • -d, --data
    • -y, --yes

These are same command.

zabbixctl hosts -m '{"name": "some_name"}' update -d '{"state": 1}' -y
zabbixctl hosts -m '{"name": "some_name"}' update -d '{"state": "1"}' -y
zabbixctl hosts -m '{"name": "some_name"}' disable -y

1.4 zabbixctl host graphs Options Command

1.4.1 Command

1.4.2 list

1.4.3 delete

  • options
    • -y, --yes

1.4.2 Options

1.4.2.1 -m, --match

This command delete graphs which is in hosts which is matched regex.

zabbixctl hosts -m '{"name": "some_name"}' graphs delete -y

1.5 zabbixctl host interfaces Options Command

1.5.1 Command

1.5.1.1 list

1.5.1.2 usedns

Use dns, not ipaddress

  • options
    • -y, --yes

1.5.1.3 update

These are same command.

  • options
    • -y, --yes
zabbixctl hosts interfaces update -d '{"useip": 0}' -y
zabbixctl hosts interfaces update -d '{"useip": "0"}' -y
zabbixctl hosts interfaces usedns -y

LICENSE

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zabbix_controller-0.1.17.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zabbix_controller-0.1.17-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file zabbix_controller-0.1.17.tar.gz.

File metadata

  • Download URL: zabbix_controller-0.1.17.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.17 CPython/3.7.3 Darwin/18.5.0

File hashes

Hashes for zabbix_controller-0.1.17.tar.gz
Algorithm Hash digest
SHA256 a5e1a777fd3702811c12ee90cbaace5a8b5238b4926514c827318affca4b81c1
MD5 dbce9f992752e4a61015a19abe8933e6
BLAKE2b-256 3ce8fabcdcfb3062ce1eb4c1a58c3783348b257681623494b65243d38f5bf644

See more details on using hashes here.

File details

Details for the file zabbix_controller-0.1.17-py3-none-any.whl.

File metadata

  • Download URL: zabbix_controller-0.1.17-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.17 CPython/3.7.3 Darwin/18.5.0

File hashes

Hashes for zabbix_controller-0.1.17-py3-none-any.whl
Algorithm Hash digest
SHA256 8b7a056ffe96739c45100b2614ce695a276f49cbd7ac17087e439081adb6779f
MD5 6ae8b13aa69b0a6a7a7bbed677c0be86
BLAKE2b-256 8834f8994f4a1f2359e78f1ef1bf2d027d81c0f4bbb3d2a5fb54af28e347e757

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page